Loading...
 

History: Template Overview

Preview of version: 2

(from 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 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

History

Advanced
Information Version
Mon 15 of Feb, 2016 12:51 GMT Jyhem 17
Mon 15 of Feb, 2016 12:47 GMT Jyhem 16
Wed 19 of Mar, 2014 01:27 GMT marclaporte 15
Sat 27 of Jul, 2013 07:08 GMT haggis73 changed url and comment to smarty. 14
Wed 30 of Jun, 2010 07:33 GMT chibaguy Some updating. 13
Wed 30 of Jun, 2010 06:45 GMT chibaguy Changed bold line to heading. 12
Wed 30 of Jun, 2010 06:44 GMT chibaguy typo 11
Wed 30 of Jun, 2010 06:43 GMT chibaguy Some updating. 10
Tue 27 of Jan, 2009 12:37 GMT chibaguy Updating 9
Tue 27 of Jan, 2009 12:34 GMT chibaguy Some updating. 8
Wed 08 of Oct, 2008 05:18 GMT chibaguy Some updating. 7
Mon 09 of Jun, 2008 15:12 GMT Oswaldo1965 6
Mon 21 of Apr, 2008 20:24 GMT mlpvolt 5
Fri 28 of Dec, 2007 20:30 GMT mlpvolt 4
Mon 20 of Feb, 2006 02:32 GMT chibaguy Minor edits. 3
Fri 17 of Feb, 2006 06:56 GMT admin Content added from doc.tw.o 2
Fri 17 of Feb, 2006 02:41 GMT system created from structure 1

Switch Theme

Layout

Latest Changes

No records to display ...more

Subscribe to Tiki Newsletters!

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other big news!
Contribute to Tiki

Site Config