In Dotclear, themes inherit from one of 3 templates sets : mustek (used by default if the theme does not specify which set it inherits from), currywurst or dotty. If a theme does not provide specific versions of template files like home.html
, post.html
, category.html
or others, Dotclear 2 will use the files available in the template set to render the pages.
Since Dotclear 2.1, you can specify what theme is the parent of another theme. A theme will be called child when it inherits from a parent theme. The child theme can use the template files from the parent theme, thus avoiding to duplicate all the tpl files.
This behavior is extended to PHP files:
_public.php
file, this one will be loaded._public.php
file, this file will be loaded as well.This will allow you to use new template tags and new URL managers in the child theme.
Search order of a template file when rendering:
Every tpl tag (like {{tpl:BlogThemeURL}}) will point to the child theme URL, even if it only appears in a template provided by the parent theme.
Everything is done in the _define.php
file of the child theme:
$this->registerModule( /* Name */ "My amazing theme", /* Description*/ "Example theme based on Blue Silence", /* Author */ "Pep", /* Version */ '1.0', /* Parent ID */ 'blueSilence' );
The "My amazing theme" theme is a child of the "Blue Silence" theme.
Important:
To define the parent theme, use the theme ID (its directory name, e.g.blueSilence
), not its name (Blue Silence).