====== DokuWiki Template Development ====== You can customize the design of [[:DokuWiki]] by creating a new template. A template is determined by mainly some PHP and CSS files stored in a directory beyond the ''/lib/tpl/'' directory. ===== Getting Started ===== The easiest way to create a new template is by taking an already existing one as starting point. It's a good idea to use the starter template because it is clean and follows the DokuWiki template standards. - Install the [[template:starter]] template (optionally, its "minimal" branch is a cleaner starting point) - Rename the ''lib/tpl/starter'' directory to ''lib/tpl/yourname'' - Select the new template in the configuration manager - Then change your template to your heart's desire; to understand how DokuWiki templates are built, have a look at the [[#directory layout|template files]] and how DokuWiki handles [[CSS]] - When your template is ready, consider [[#Publishing a Template on dokuwiki.org|publishing]] it on DokuWiki's [[:template]] page. === Template naming conventions === A valid template name (directory): * Should only contain the characters a-z and 0-9. * Dot ''.'', dash ''-'' and underscore ''_'' are **not** allowed as: * DokuWiki's infrastructure doesn't support them anywhere * Using underscore will also give a [[:popularity|popularity]] rating of zero. * Spaces '' '' are also not allowed in the base name of the template defined in ''template.info.txt'' and the folder name, including the page name used in the [[:templates|template listing]] e.g. ''template:myfirsttemplate'' * If the same name is used by two different templates * they are mutually exclusive and inherent incompatible, * furthermore only one of them can have a template homepage on [[:dokuwiki|dokuwiki.org]] **It is important to have a unique base field value (i.e. template name) in [[devel:template_info|template.info.txt]] or an already existing template with that name could be overwritten.** ===== Directory Layout ===== Templates should follow the following directory structure (all paths are relative to the template directory). CSS files are specified in the ''[[style.ini]]'' file. Use as many files as you like, but you should at least provide one CSS file for the screen presentation and one for printing. * ''/lib/tpl/