regex_template plugin by Cédric Villemain
Choose template from regex on $ID
Last updated on 2009-10-14. Provides Action.
Compatible with DokuWiki 2009-02-14b.
This plugin works similar to namespace templates but the template to use is chosen based on a configuration matching regular expressions against the page name.
Download and install the plugin using the Plugin Manager using the following URL. Refer to Plugins on how to install plugins manually.
There is one configuration option to add regex, they must be added one per line, take care of spaces, in the following format:
pattern,replacement
pattern and replacement MUST follow the preg_replace rules.
/.*:info:start/,templates:info_start /.*:info:.*:issue/,templates:info_issue
You here just have to edit the templates/info_start and templates/info_issue to make them templates (no worry of _template.txt and __template.txt they are used if the regex does not match or if the templates in the regex does not exists.
NS replace does not work, $id needs to be replaced by $ID (line 65 in action.php)
// replace placeholders $tpl = str_replace('@ID@',$ID,$tpl); $tpl = str_replace('@NS@',getNS($ID),$tpl);
Otherwise great plugin. Jörg