Now, updated for Tiki 8!
Now accepting new user registrations! Become a contributor.
Modifying Templates
Tiki uses Smarty (TPL) template files to control the presentation (that is, the display) of each page of your Tiki website. The Smarty template engine allows you to separate the presentation (look & feel) from the logic (programming).![]() | Tip: New to Tiki? See "Editing Templates" |
![]() | Note: Do not confuse these Smarty (TPL) template files with the Tiki content templates. |
![]() | Tip: For complete information on using Smarty, see http://www.smarty.net/ |
Any template files that you modify should be placed in a custom theme folder — do not modify the template files in the ../templates/*.tpl folder. See Saving Your Theme for more information.
![]() | Note: Creating modified template files as part of your custom theme may make it more difficult to upgrade your Tiki. You will need to re-apply your customizations to the new set of templates each time you upgrade. |
Finding the Right Template
So, how do you figure out which of the more than 800 template (TPL) files you need to edit? Some template files have a direct, one-to-one correlation with a PHP file. This means you simply need to look a the browser's address bar to determine the correct template.![]() | Tip: The Template Map provides a detailed listing of which templates include others. |
For example, the template used for the site registration page (tiki-register.php) is tiki-register.tpl.
For other pages it is not nearly that easy. Some pages, such as the event calendar (tiki-calendar.php) are actually made up of five (or more!) different templates. Luckily, there is an option to help you find which templates are used.
By viewing the HTML source of a generated Tiki page, you can determine which template (TPL) is responsible for what content, as shown below:
![]() | Warning: Do not use the Smarty Template usage indicator on a "live" site. Tiki will include the template comments in all generated content, including messages and email, and these comments will be visible to all site users. |
Including Wiki Syntax
The Tiki template (TPL) files are created with the Smarty template engine. Smarty templates use a mixture of XHTML and PHP — not Tiki's wiki syntax. For example, to bold text in a Smarty TPL template file, use:<strong>text</strong>
not:
__text__
However, there may be places that you need to use some wiki syntax. For example, you may want to include a wiki heading in template, use:
{wiki}
!Level 1 Heading
...
{/wiki}Using modules and plugins
To include a Tiki module or plugin in a Smarty template (TPL) file, you must use the {literal} tag, in addition to the {wiki} tag, as shown previously.For example, if you wanted to include the Tiki search module at the bottom of every web page on your Tiki site, you could add the following to the footer.tpl template:
Adding the Search module to a template
{wiki}
{literal}
{MODULE(module=>search, show_object_filter=y, advanced_search=y) /}
{/literal}
{/wiki}![]() | Tip: You could also use the simplified version of the module: {module module=search show_object_filter=y advanced_search=y}
|
See Using Modules for additional information about Tiki modules.
When adding plugins, you can use the {wikiplugin} tag to avoid having to use the {wiki} and {literal} tags:
Adding a wiki plugin to a template
{wikiplugin _name="NAME OF PLUGIN" PARAMTER="VALUE" PARAMTER="VALUE"}{/wikiplugin}
Contributors to this page: Rick Sapir
.
Page last modified on Thursday, June 16, 2011 09:51:49am EDT by Rick Sapir.
The content on this page is licensed under the terms of the Copyright Information.
Sidebar
What do you think?
What do you think of this project?
"..This is the only Tiki site that explained things enough that I could follow and understand. Thank you!"
Is Essentials helpful?




