DokuWiki

It's better when it's simple

User Tools

Site Tools


template:dokuwiki

DokuWiki Template

Compatible with DokuWiki

(bundled)

template DokuWiki's default template since 2012

Last updated on
2014-06-04

This is the new default template bundled with DokuWiki since “Adora Belle” (2012-10-13 release).

The template was designed by Clarence Lee. Read more about the template's story.

Features

  • Optional sidebar
  • Mobile support (Desktop, Tablet, Phone sizes)
  • HTML5 compatible

Customizing

The template supports some simple customizing. If you need more than that you should create your own template, though. Check DokuWiki Template Development for that.

Adding a Sidebar

The template supports a sidebar as configured in Configuration Setting: sidebar.

Changing the Width and other Styles

Additionally to the standard guaranteed style.ini placeholders, the template uses the following variables:

placeholder variable meaning
__background_site__ background colour of the whole site
__link__ colour of links
__existing__ colour of links to existing internal pages
__missing__ colour of links to missing internal pages
__site_width__ width of the whole site
__sidebar_width__ width of the sidebar

E.g. you can adjust the width of the template by overriding the __site_width__ variable. Simply create the file conf/tpl/dokuwiki/style.ini (or old location: lib/tpl/dokuwiki/style.local.ini in Adora Belle) and set the variable accordingly. You can either use a fixed value (px or em) or a percent value (%) if you prefer a dynamic width.

conf/tpl/dokuwiki/style.ini
[replacements]
__site_width__  = "100%"

You can use this file to override any other variable from the style.ini as well. E.g. for changing some of the colors.

The Logo, Favicon and Apple Touch (bookmark) icons are looked up from multiple locations. The default icons (DokuWiki logo) provided by the template can be easily exchanged by uploading the image files to their correct locations using the Media Manager popup or Fullscreen Media Manager.

Here are the locations checked by the template code:

  • The site's logo
    • :wiki:logo.svg
    • :logo.svg
    • :wiki:logo.png
    • :logo.png
    • lib/tpl/dokuwiki/images/logo.png
  • The favicon
    • :wiki:favicon.ico
    • :favicon.ico
    • lib/tpl/dokuwiki/images/favicon.ico
  • The bookmark icon used by Apple and Android devices
    • :wiki:apple-touch-icon.png
    • :apple-touch-icon.png
    • lib/tpl/dokuwiki/images/apple-touch-icon.png

Please make sure that those namespaces (either root or wiki:) are readable to all users. Otherwise the image will be broken to users who are not logged in.

See also: DokuWiki Logo

Action Hooks

Plugins can integrate into the template without any need for modifying the template by providing an Action component to handle the custom action hooks triggered by the template.

TEMPLATE_PAGETOOLS_DISPLAY

This event allows to extend or modify the floating pagetools menu. $event->data['items'] contains an array with HTML for each item in the menu. Plugin authors should match the existing style and provide needed CSS and background image. You can use different styling or classes or markup depending on $conf['template']. $event->data['view'] contains information whether the pagetools are called in the main or the detail view.

Supported Include Hooks

Include hooks allow you to add additional HTML or PHP to the template without modifying any of the template files itself, making them safe to survive an update. Just create the appropriate file in either the template directory (lib/tpl/dokuwiki/) or your conf/ directory.

Filename Position of included HTML
meta.html Inside the HTML <head>, use this to add additional styles or metaheaders
sidebarheader.html At the top of the sidebar (if any)
sidebarfooter.html At the bottom of the sidebar (if any)
pageheader.html At the top inside the content box, above the actual content
pagefooter.html At the bottom inside the content box, below the actual content
header.html At the top of the page, above the logo and wiki title
footer.html At the very end of the page after all other page content
template/dokuwiki.txt · Last modified: 2024-02-06 14:13 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki