Table of Contents

Plugin File Structure

There are two structures for the files of a DokuWiki plugin class. The structure chosen determines the name for the plugin class(es).

  1. <dokuwiki>/lib/plugins/<plugin name>/<plugin type>.php
    the plugin class name will be <plugin type>_plugin_<plugin name>
    e.g. file                                     class
         <dokuwiki>/lib/plugins/acl/admin.php  => admin_plugin_acl
    


  2. <dokuwiki>/lib/plugins/<plugin name>/<plugin type>/<filename>.php
    This structure allows several plugin classes of one plugin type within one plugin, the class names will be <plugin_type>_plugin_<plugin name>_<filename>,
    e.g. file                        type                 class
         <dokuwiki>/lib/plugins/code/syntax/code.php   => syntax_plugin_code_code
         <dokuwiki>/lib/plugins/code/syntax/file.php   => syntax_plugin_code_file
    


Note that an _ (underscore) is a reserved character and cannot be use in the <plugin name>.

A plugin may contain several different plugins types as well as several different plugin classes of each type.

In addition, a plugin can (optionally) take advantage of other built-in facilities to have its styles, JavaScript, localisation, and configuration included in DokuWiki.

All paths and files are relative to the plugin root directory.

How to include more than one JavaScript file?

DokuWiki supports a special include syntax which can be used to source other files in a JavaScript file.

How to include more than one CSS file

The CSS should be merged into one file.