create new tag
, view all tags
ALERT! NOTE: 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 TWiki.

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 TWiki/Plugins/EmptyPlugin.pm to <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.

Syntax Rules


Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %EMPTYPLUGIN_SHORTDESCRIPTION%

  • 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:
    • Set EXAMPLE = got it!

  • Debug plugin: ( TWiki sets $debug in your plugin. See output in data/debug.txt.)
    • Set DEBUG = 0

Plugin Installation Instructions

  • This plugin is preinstalled, you do not need to install it.

Plugin Info

Plugin Author: TWiki:Main.AndreaSterbini, TWiki:Main.PeterThoeny, TWiki:Main.CrawfordCurrie
Copyright: © 2001-2006, TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 01 Feb 2006
Change History:  
01 Feb 2006: Dakar changes
21 Mar 2004: Added afterSaveHandler
14 Jul 2001: Changed to plug&play
27 Feb 2001: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins/Benchmark: GoodStyle 99%, FormattedSearch 99%, EmptyPlugin 99%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/EmptyPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/EmptyPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/EmptyPluginAppraisal

Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

-- TWikiContributor - 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 registerTagHandler, 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 EmptyPlugin.pm over in subversion, which I'm not quite ready to do yet.

Another thing: The example shows getting a config variable, $exampleCfgVar, which is defined as a my variable in initPlugin. Unless the variable is only used in initPlugin, 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...

-- DougClaar - 10 May 2006

Please use the Support forum if you have questions about TWiki features. This comment section is about the documentation of this topic.
Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r12 - 2006-05-11 - DougClaar
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.