Loading...
 
Skip to main content

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.
        

History

Advanced
Information Version
Sun 02 of Apr, 2023 11:33 GMT-0000 Gary Cunningham-Lee Page renamed from Theme Options to Theme Options aka Child Themes. Semantic alias redirect created 4
Mon 25 of Jan, 2016 11:49 GMT-0000 Gary Cunningham-Lee Examples made consistent. 3
Mon 25 of Jan, 2016 11:48 GMT-0000 Gary Cunningham-Lee Updated for new theme file hierarchy. 2
Sat 23 of May, 2009 05:28 GMT-0000 Gary Cunningham-Lee Page created. 1