This is a DistributionDocument. Please help maintain high quality documentation:
This is a wiki, please fix the documentation
if you find errors or incomplete content. Put questions and suggestions concerning the documentation
of this topic in the comments section below
. Use the Support
web for problems you are having using
Empty TWiki Plugin
This is an empty Plugin you can use as a template to build your own TWikiPlugins
. This Plugin does nothing, but is ready to be used.
To create your own Plugin:
- Copy file
<name>Plugin.pm and customize the plugin.
- Create a
<name>Plugin topic in the TWiki06x00 web. Do so by visiting http://TWiki.org/cgi-bin/view/Plugins/PluginPackage#NewPlugin and starting a new topic to get the default plugin topic text (don't save the topic). Customize your plugin topic to your needs.
- See details in TWikiPlugins.
Plugin settings are stored as preferences variables. To reference
a plugin setting write
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Empty Plugin used as a template for new Plugins
- Your own setting, for example:
- Debug plugin: ( TWiki sets
$debug in your plugin. See output in
Plugin Installation Instructions
- This plugin is preinstalled, you do not need to install it.
Related Topics: TWikiPlugins
- 01 Feb 2006
Comments & Questions about this Distribution Document Topic
I modified this a bit to try and indicate that your plugin doesn't have to test for the DEBUG variable, as that wasn't obvious to me. If it is obvious to everyone else, you can take it back out...
I'm also looking for a place to add some comments about the EmptyPlugin
, or more correctly, the functions in it. For example, what's a REST handler? I found some tidbits about it on the web, but it isn't really well explained.
More importantly, I'd like to point out somewhere that, if you
, you can return stuff, which gets inserted into the TWiki page. If you return undef, then the original text gets output. Or, you can return error diagnostics. (note, my previous version of this comment had a "stupid coder error" in it, which I've fixed). None of this is documented--at least as far as I could find--anywhere. And I couldn't find a place where it could
be documented, short of modifying
over in subversion, which I'm not quite ready to do yet.
Another thing: The example shows getting a config variable,
, which is defined as a
. Unless the variable is only
, having it be scoped to just that function won't be particularly helpful. But it isn't clear from the documentation if it is ok to just declare it as a global. I think that would make mod_perl unhappy, but I'm not sure.
I guess there needs to be some more documentation on this whole plugin thing, eh? Which gets back to the "where" question in my second paragraph...
- 10 May 2006