History: Template Overview
Preview of version: 4
(from Style and Themes - to be updated)
How to modify .tpl files
The .tpl (template) files are written using the Smarty template language, which has its own syntax, etc. See smarty.php.net.
To modify the layout of Tiki in your theme, edit theme-specific copies of default Tiki template files. While CSS editing is used to specify the details of page appearance, it is necessary to edit template files to make major rearrangements of items on the page. One example is to change the normal three-column layout to two or one columns, or to add a module to the top bar.
CMS Level Templates (Frequently Modified)
- tiki.tpl: the main template defining the layout of the whole application
- error.tpl: used to display errors
- header.tpl: the HTML header
- tiki-top_bar.tpl: top identity and navigation bar
- tiki-bot_bar.tpl: bottom links/credits bar
- the template files with names like tiki-print.tpl are used for printable representation of objects so usually don't need to be changed.
As you can see, you can modify the layout of the whole tiki application by just changing one file or a few files.
Wiki Templates (More Advanced)
- tiki-showpage.tpl - main wiki template, upper controls
- tiki-page_bar.tpl - lower controls
Unless there is a special need to emulate an existing theme, the best course is probably to base new theme templates on the default Tiki templates, that is, on templates/tiki.tpl, templates/tiki-top_bar.tpl, and so on.
Overriding templates
The template files for each theme are stored in a directory with the same name as the theme (less the ".css" file type indicator) in the templates/styles directory — for example, templates/styles/screensite.
A theme's files will override any default template file. You just need to put a modified template file in the directory templates/styles/custom_theme_name.
For example, if we want to modify the forum listing in our screensite theme, we'd just place a copy of the file templates/tiki-forums.tpl in templates/styles/screensite/ and then edit the new theme-specific copy of the tiki-forums.tpl file.
Tiki will substitute whatever is in your custom theme directory for the .tpl files in the default directory.
This technique works on files in the subdirectories, too. E.g., to change the application menu in your theme, just copy the file mod-application_menu.tpl from templates/modules/ to templates/styles/custom_theme_name/modules/.