History: Theme Options aka Child Themes
Source of version: 1
- «
- »
Copy to clipboard
New in Tiki 3.0 is the "theme option". Theme options are an easy way to have variations of a theme that is already installed at a Tiki site. Typically they change the "base" theme's coloring, font style, column widths or other such details. When a theme has one or more options, there will be a second dropdown list wherever theme selections are made or assigned in Tiki, such as the user preferences page, the Look and Feel admin page, and the theme-switching module. The option can also be activated via a URL, like ''tiki-switch_theme.php?theme=strasa.css&option=mono.css''. !! How to make a theme option To make a theme option, create a new CSS file, add the selectors and properties that you want the theme option to have (that is, the selectors/properties of the base theme that you want the theme option to override), and save it in an "options" directory under (inside) the styles directory of the base theme. For example, Strasa's "Mono" theme option CSS file is located at ''styles/strasa/options/mono.css'' If a theme already has an options directory, use that one; if not, make a new one. !! Theme option background images If the theme option has alternate background images, these should go in a new directory with the same name as the theme option, such as ''styles/strasa/options/mono/'' Of course, the theme option CSS file's URL path will point to the images in the new directory, such as ''background {url(mono/bg.png)}''. There's no need to modify the base CSS file, or to put anything such as an import statement in the option file, for things to work. The option file is simply loaded after the base file, so it overrides properties of the base file. !! Advantages Beyond being a quick way to modify an existing theme, theme options are a good way to have a modified version of the standard Tiki themes (or other themes updated elsewhere) at a site. This way, a site can have its own modification of a theme, and when the base theme is updated and installed during a site upgrade, the theme option isn't overwritten and will still function as expected, maybe just needing to be edited if any of what it's overriding changed. !! Possibilities Maybe theme options will be created for distribution for specific themes or general use. Once the quick and easy power is realized, there is a lot of potential in the new theme option feature.