1 Customizing Your Website
kirsle editó esta página 2014-09-11 23:02:05 -07:00

Rophako has a dual templating system: when it wants to show a page, it will prefer to use your custom HTML template to render that page, before falling back to its default built-in pages (including pages for plugins such as the Blog or Photo Albums).

So, when Rophako wants to display a web page to the user, it looks in various locations for it:

  1. First it will check the user's custom template folder (the SITE_ROOT variable from config.py)
  2. Then it will check its built-in (fallback) template folder (rophako/www/)
  3. Then it will check the various plugin template folders (i.e. rophako/modules/blog/templates)

So as an example, the Blog plugin might want to show the template blog/entry.html to the user. It will first search for a file named blog/entry.html in your SITE_ROOT, and if it doesn't find it, it will look in the built-in default site; if it doesn't find it, it will scan through the plugins' template folders (and will eventually find it at rophako/modules/blog/templates/blog/entry.html).

All of the core features of Rophako (user account, blog, photo albums, comments, etc.) exist in the default site and plugin folders, so the CMS is already fully functional out-of-the-box. You can override files in the default site by putting files with the same name in your SITE_ROOT folder. For example, the default SITE_ROOT is set to the "site/www" folder in the git repo, and if you put a file at site/www/layout.html there, it will change the web design template for the Rophako site. A file at site/www/index.html will change the index page of your site away from the default.