History: Template Overview
Source of version: 2
Copy to clipboard
''(from [http://doc.tikiwiki.org/tiki-index.php?page=Styles+and+Themes|Style and Themes] - to be updated)'' ! How to modify TPL files The TPL files are written using the Smarty template language, which takes a little getting used to. See [http://smarty.php.net/|smarty.php.net]. To modify the layout of Tiki in your theme, just edit the files you copied. You can add images, define columns, etc. The specific template files will differ based on which pre-existing theme you choose, but some of the commonly used files are: * ''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 navigation bar * ''tiki-bot_bar.tpl'': bottom navigation bar * the template files with names like ''tiki-print.tpl'' are used for printable representation of objects so you usually don't want to change them. As you can see you can modify the layout of the whole tiki application by just changing one file. !!!Overriding templates As we saw above, the template files for custom themes all live in a directory named something like ''templates/styles/custom_theme_name''--for example, ''templates/styles/screensite''. The default template files live just one directory below there, in ''templates'' and its subdirectories, notably: * ''templates/mail'' * ''templates/modules'' When creating a theme you can override any template file. You just need to put a modified template file in the directory ''templates/styles/custom_theme_name''. For example, if we wanted to modify the forum listing in our ''screensite'' theme, we'd just copy the file ''tiki-forums.tpl'' from * ''templates/tiki-forums.tpl'' * to * ''templates/styles/screensite/tiki-forums.tpl'' Then we'd edit our new copy of the file. Tiki will substitute whatever is in your custom theme directory for the TPL files in the default directories. ^ 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/mod-application_menu.tpl'' * to * ''templates/styles/custom_theme_name/modules/mod-application_menu.tpl'' ^