Table of Contents
snippets plugin
Compatible with DokuWiki
2009-12-25, 2010-11-07, 2011-05-25, angua, 2012-09-10,hrun
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Previous author Michael Klier.
Description
This plugin adds a new button to editor toolbar. When clicking on it a popup shows up, showing a list of page templates which can be previewed and inserted into the editor window. The list of templates is defined using a Wiki page which contains a simple unordered list of links to pages which should be used as templates.
Installation
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
You can also install the plugin using git:
% cd <dokuwiki>/lib/plugins % git clone git://github.com/cosmocode/dokuwiki-plugin-snippets.git snippets
IMPORTANT: You have to invalidate/delete the cache before the new button appears in the toolbar.
Configuration
You can specify the wiki page which defines the list of page templates, defaults to snippets
.
Usage
Just create the page you configured in the configuration manager (defaults to snippets
) and add your list of template pages (nothing else). Then create your template pages as well and you're ready to go (you might want to save all your templates in a dedicated namespace so you can use the hidepages option to hide them in the index etc.).
You can use the following syntax inside your template to provide additional comments which will get stripped out when you insert the template into the current page you're editing.
<snippet> Additional comments, i.e. you have to provide the following information: * foo * bar </snippet>
Bugs / Feature Requests
Please report bugs and feature requests at the bug tracker.
Changelog
A complete changelog is available here.
- An error occurred while fetching this feed: https://github.com/cosmocode/dokuwiki-plugin-snippets/commits/master.atom
Discussion
Don't post bug report here, use the bug tracker instead.
get it working
The hint “to clean the cache or to invalidate it”, didn't help much. (deleting files in cache, attic, etc. folders didn't show any effect; neither before nor after installation or visiting page)
What reproducibly worked:
- unpack clean installation
- copy plugin in plugin-folder
- create a page “snippets” with a bullet-list in the page-folder (root)
- run install.php
- when open editing mode you should see the icon
hint: just move the user data to new version and everything's fine.
annotation: in general “icon-editing plugins” are easy to install
More ideas on how to get it working
If the template icon does not show up in the toolbar, follow these steps:
Make sure the page snippets
has this content:
* templatepagename
Purge the javascript cache by following the instructions on purging_the_cache
Purging the cache in your browser is typically done by pressing CTRL-F5 or ALT-F5.
helpful addition
use indexmenu-plugin to create an unordered list:
{{indexmenu>.|tsort context id#2}}
The files are stored in the configured folder/ subfolders, e.g.
/templates
orderform.txt
contentview.txt
/plugins
acl.txt
indexmenu.txt
...
/<further folders>