Loading...
 
Skip to main content

History: Theme Options aka Child Themes

Preview of version: 2

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 CSS rules 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 a location with a path like this: "themes/parent-theme-name/options/option-theme-name/css/option-name.css. For example, FiveAlive's "Kiwi" theme option style sheet file is located at

themes/fivealive/options/kiwi/css/kiwi.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 can go in a new directory with the same name as the theme option, such as

themes/fivealive/options/kiwi/images/

There's no need to modify the base CSS file, or to put anything such as an import statement in the option file, for the theme option 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 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.

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