Learn about DokuWiki
Learn about DokuWiki
Requirements: This plugin requires jQuery and was originally designed for use with the DokuWiki Template. In its current form, it should work with any template.
There is a simplified branch which will work only with the dokuwiki template: dokuwiki.
This plugin converts Dokuwiki headers into toggles which open and close the sections immediately below them.
When installed, the sections will initially be closed. Clicking on a header will open the section immediately below the header. Clicking on it again will close the section. Using the two buttons described below, the user can open and close all the sections with a single click.
Inserting the following into the page will create two buttons, one which will open all the sections with one click and one which will close them:
These buttons will be hidden if toggling is disabled, as described below under Configuration.
This plugin was originally written for the Dokuwiki template and it defaults to settings for the dokuwiki template. If you are using the Dokuwiki template, it will work right out of the box and will convert all headers from h1-h4 into toggles.
|platform||all, mobile, none||all||Selects the platform(s) on which to implement section toggling.|
|type||none,id,class||none||Indicates whether the div which encloses the affected headers is identified by a class or an id.|
|name||dokuwiki__content1)||Name of the class or id which identifies the enclosing div.|
|headers||h1-h6||h4||Smallest header to activate as toggle. All headers between h1 and this setting will be toggles.|
|suspend||1,0||0||If set to true the plugin will be inactivated and no toggles will be set.|
|xcl_headers||Checkboxes to select headers which should not be set as toggles|
Notes on the Options
all: section toggling will appear on all platforms, mobile and standard desktop systems
mobile: mobile only, desktops are excluded
none: toggling is disabled on all platforms.
When the toggle buttons are included on a page, they will not display if the platform is excluded from section toggling. So, if you want toggling only on mobile devices, you can still include these buttons on your page but they will not display on standard desktop systems.
When the Dokuwiki template is in use, this plugin uses the template's platform recognition facility. For other templates, it uses the
Mobile_Detect class from http://mobiledetect.net. You can go to that site to update the detection software. Currently, we are at version 2.8.11.
default template, which was the template that preceded the dokuwiki template, contains the following structure:
The wiki page is included in the div which is defined by the class named
page. To use this template, then, you would set type to
class and name to
If you are using the dokuwiki template, the default settings for type and name will take precedence over these configuration settings, as they are hard-coded into the plugin. If you want to use the dokuwiki template with changes to its structure, then you must give it a different template name.
There is currently a branch which enables you to create a container
div for the page, in which case it is not necessary to set the name option for identifying the div which holds the wiki content. However, you must set the type option either to
id or to
This feature uses two macros:
You place the
openDIV at the top of your wiki page and the
closeDIV at the bottom. This will create a div with a
section__toggle id. The entire wiki page will then be enclosed within this