Customizing Themes | |
In Tiki, the theme is controlled by three types of files which specify the html layout — .tpl files - or templates that contain the HTML and logic (along with PHP files), .css files - Cascading Styles Sheet files contain the styling for the html elements, and images - the graphics files (.png, .gif, .jpg). For an overview of existing themes, see themes. |
How to create a custom theme | |
Tiki themes control both the layout or structure of a site and its overall look. You can alter the position of elements on your Web pages (adding/subtracting components) and you can modify stylistic elements like color and font. Thus, by creating or modifying a theme, you can define:
|
Theme file locations | |
In order to create a theme, you need to add files and folders to the styles folder and the templates folders in the main directory.
At this point, your new theme has been created! If you go to User Preferences and check the drop-down menu for Theme, you'll find your theme listed (e.g., screensite.css). Of course, if existing-theme files were used as the base and no editing was done yet, your new theme will look just the same as the theme you based it on. |
How to modify template (.tpl) files | |
The template files are written using the Smarty template language. See Smarty.net. |
Edit Smarty templates via Tiki web interface | |
Please see Edit Templates |
The layout of Tiki | |
To modify the layout of Tiki in your custom theme, edit its CSS file and edit any template files that you may have copied into the templates/styles/yourtheme folder. You can add images, resize and reorder things, define columns, etc. See also Theme layout schema. The specific template files will differ based on which pre-existing theme you choose, but some of the commonly used files are:
As you can see, it easy easy to modify the layout of the whole tiki application by just changing the stylesheet or possibly a template file or two. |
Overriding templates | |
The default template files live in the templates directory, and its subdirectories such as:
As we saw above, the template files for a custom theme live in a directory named something like templates/styles/screensite. Theme-specific versions of default template subdirectory files live just one directory below there, in templates and its subdirectories, notably:
This technique works on files in the subdirectories, too. E.g., to change the application menu in your theme, copy the file mod-application_menu.tpl from
to
When creating a theme you can override any template file. You just need to put a modified template file in the directory templates/styles/screensite or its subdirectory, as appropriate. (A theme name with one of these characters .- has special behavior. See below 'To have multiple .css with only one templates set'.) For example, if we wanted to modify the forum listing in our screensite theme, and wanted to modify it more extremely than can be done with CSS, we'd copy the file tiki-forums.tpl from
to
Then we'd edit then new, moved copy of the file. Tiki will substitute whatever is in your custom theme directory for the same template files in the default directories. |
Multiple themes with a common custom template set | |
You can have more than one theme sharing a common set of custom templates if you name the variant themes with a hyphen preceded by the name of the theme that first has the custom templates. For instance, the themes "screensite-gold" and "screensite-silver" will both use the templates from the directory templates/styles/screensite. This is convenient when you want to do minor style change between sections or between multitikis. |
Presentation | |
The presentation of elements, the visual style of your theme, is created using CSS (Cascading Style Sheets). So, the next step in building a custom theme is to make a CSS file for it. W3C provides tutorials and other tools for learning CSS principles: http://www.w3.org/Style/CSS.
|
Overriding global special-purpose CSS files | |
In Tiki>=3.0, some css are in the directory TIKI_ROOT/css, for example, calendar.css (used in calendars) and cssmenu.css and similar (used in css menus). It is possible to override them by creating the file in styles/your_style/css. |
Theme Options | |
(since version 3.0) Theme options provide for variations of a theme, for example, changing colors, column widths or other details. A theme's option CSS files, if it has them, are in the styles/themename/options folder. These files can be named anything, but only one (or none) is active at any given moment, and will override the main CSS rules. |
Overriding icons | |
In Tiki>=2.0, the job is part-way done. It is possible to overwrite the icons (the one that are used in the Smarty templates with the Smarty function The icon file must be in styles/your_style directory For instance if you want to overwrite img/icons/module.png and img/icons/omodule.png(the two icons used for module flipping), put the images to be used in styles/your_domain/your_style/img/icons.
Since you can change the CSS file and you can override any template your themes can make your Tiki site look like anything you want. The only limit is your imagination. |