Foswiki Plugins
Add functionality to Foswiki with plugins
Overview
You can add plugins to extend Foswiki functionality without altering the core code. A plug-in approach lets you:
- add virtually unlimited features while keeping the main Foswiki code compact and efficient;
- heavily customize an installation and still do clean updates to new versions of Foswiki;
- rapidly develop new Foswiki functions in Perl using the plugin API.
Everything to do with Foswiki plugins - demos, new releases, downloads, development, general discussion - is available at Foswiki.org, in the
Foswiki:Extensions web.
Foswiki plugins are developed and contributed by interested members of the community. Plugins are provided on an 'as is' basis; they are not a part of Foswiki, but are independently developed and maintained.
Most
TWiki® plugins can also be used with Foswiki if the
TWikiCompatibilityPlugin is installed (it is by default).
See other types of extensions: Contribs,
Skins
Installed Plugins
- TWikiCompatibilityPlugin (Foswiki-1.0, $Rev: 2422 (20 Feb 2009) $): add TWiki personality to Foswiki
- GluePlugin (2.20, 3494): Enable markup to span multiple lines
- IfDefinedPlugin (v2.00, 3637): Render content conditionally
- SpreadSheetPlugin (06 Jan 2009, $Rev: 1842 (20 Feb 2009) $): Add spreadsheet calculation like
"$SUM( $ABOVE() )" to Foswiki tables and other topic text - AutoTemplatePlugin (1.0, $Rev: 5797 (2009-12-16) $): Automatically sets VIEW_TEMPLATE and EDIT_TEMPLATE
- BreadCrumbsPlugin (v2.42, 4694): A flexible way to display breadcrumbs navigation
- CommentPlugin (Foswiki-1.0.1, $Rev: 1984 (20 Feb 2009) $): Quickly post comments to a page without an edit/preview/save cycle
- CompareRevisionsAddonPlugin (09 Jan 2009, $Rev: 1904 (2009-01-09) $):
- DBCachePlugin (4.30, 4.30): Lightweighted frontend to the DBCacheContrib
- EditChapterPlugin (2.03, 4371): An easy sectional edit facility
- EditTablePlugin (4.20, $Rev: 2961 (2009-03-10) $): Edit tables using edit fields, date pickers and drop down boxes
- ExplicitNumberingPlugin ($Foswiki 1.0 beta $, 4054): Use the
##., ##.. etc. notation to insert outline numbering sequences (1, 1.1, 2, 2.1) in topic's text. Also support numbered headings. - FilterPlugin (1.80, 3491): Substitute and extract information from content by using regular expressions
- FlexWebListPlugin (v1.40, 4372): Flexible way to display hierarchical weblists
- HeadlinesPlugin (2.21.1, $Rev: 2931 (2009-03-08) $): Show headline news in Foswiki pages based on RSS and ATOM news feeds from external sites
- HistoryPlugin (1.5, $Rev: 2464 (2009-02-12) $): Shows a complete history of a document
- ImageGalleryPlugin (5.01, 4425): Displays image gallery with auto-generated thumbnails from attachments
- ImagePlugin (2.11, 4679): Control the display and alignment of images using an easy syntax
- InterwikiPlugin (03 Aug 2008, $Rev: 1490 (20 Feb 2009) $): Link
ExternalSite:Page text to external sites based on aliases defined in a rules topic - JQueryPlugin (2.10, $Rev: 20090710 (2009-07-10) $): jQuery JavaScript library for Foswiki
- NatEditPlugin (v4.10, 4699): A Wikiwyg Editor
- NatSkinPlugin (3.93, 4697): Theming engine for NatSkin
- NewUserPlugin (v2.01, $Rev: 3642 (2009-04-23) $): Create a user topic if it does not exist yet
- RedDotPlugin (2.01, 3650): Renders edit-links as little red dots
- RenderPlugin (3.0, 3644): Render WikiApplications asynchronously
- SendEmailPlugin (1.2.3, $Rev: 2847 (2009-03-03) $): Allows to send e-mail through an e-mail form
- SetVariablePlugin (1.00, $Rev: 4287 (2009-06-23) $): Flexible handling of topic variables
- SmiliesPlugin (04 Jan 2009, $Rev: 1751 (20 Feb 2009) $): Render smilies as icons, like
for :-) or
for :eek: - TablePlugin (1.038, $Rev: 2910 (2009-03-06) $): Control attributes of tables and sorting of table columns
- TagCloudPlugin (v2.10, 4762): Renders a tag cloud given a list of terms
- TimeSincePlugin (3.00, 3647):
- TreePlugin (1.8): Dynamic generation of Foswiki topic trees
- TwistyPlugin (1.5.3, 4750): Twisty section Javascript library to open/close content dynamically
- UploadPlugin (1.11, 1340): Attach multiple files to a topic in one go
Failed Plugins
| Handler | Plugins |
|---|
| afterAttachmentSaveHandler | DBCachePlugin |
| afterRenameHandler | DBCachePlugin |
| afterSaveHandler | DBCachePlugin TreePlugin |
| beforeCommonTagsHandler | EditTablePlugin NewUserPlugin |
| beforeSaveHandler | CommentPlugin NatEditPlugin SetVariablePlugin |
| commonTagsHandler | GluePlugin IfDefinedPlugin SpreadSheetPlugin CommentPlugin CompareRevisionsAddonPlugin EditChapterPlugin EditTablePlugin ExplicitNumberingPlugin FilterPlugin HeadlinesPlugin RedDotPlugin SmiliesPlugin |
| completePageHandler | NatSkinPlugin |
| earlyInitPlugin | TWikiCompatibilityPlugin |
| initPlugin | TWikiCompatibilityPlugin GluePlugin IfDefinedPlugin SpreadSheetPlugin AutoTemplatePlugin BreadCrumbsPlugin CommentPlugin CompareRevisionsAddonPlugin DBCachePlugin EditChapterPlugin EditTablePlugin ExplicitNumberingPlugin FilterPlugin FlexWebListPlugin HeadlinesPlugin HistoryPlugin ImageGalleryPlugin ImagePlugin InterwikiPlugin JQueryPlugin NatEditPlugin NatSkinPlugin NewUserPlugin RedDotPlugin RenderPlugin SendEmailPlugin SetVariablePlugin SmiliesPlugin TablePlugin TagCloudPlugin TimeSincePlugin TreePlugin TwistyPlugin UploadPlugin |
| modifyHeaderHandler | JQueryPlugin |
| postRenderingHandler | EditChapterPlugin EditTablePlugin NatSkinPlugin |
| preRenderingHandler | InterwikiPlugin NatSkinPlugin SmiliesPlugin TablePlugin |
| renderWikiWordHandler | DBCachePlugin |
34 plugins
Installing Plugins
Each Foswiki plugin comes with its own documentation: step-by-step installation instructions, a detailed description of any special requirements, version details, and a working example for testing. Many plugins have an install script that automates these steps for you.
Special Requirements: Some plugins need certain Perl modules to be preinstalled on the host system. Plugins may also use other resources, like graphics, other modules, applications, and templates. You should be able to find detailed instructions in the plugin's documentation.
Each plugin has a standard release topic, located in the
Foswiki:Extensions web at Foswiki.org. There's usually a number of other related topics, such as a developers page, and an appraisal page.
On-Site Pretesting
The recommended approach to testing new plugins before making them public is to create a second local Foswiki installation, and test the plugin there. You can allow selected users access to the test area. Once you are satisfied that it won't compromise your main installation, you can install it there as well.
The
Plugins page shows which plugins are: 1) installed, 2) loading properly, and 3) what plugin handlers they invoke. Any failures are shown in the Errors section. The
%FAILEDPLUGINS% macro can be used to debug failures. You may also want to check your webserver error log and the various Foswiki log files.
Some Notes on Plugin Performance
The performance of the system depends to some extent on the number of plugins installed and on the plugin implementation. Some plugins impose no measurable performance decrease, some do. For example, a Plugin might use many Perl libraries that need to be initialized with each page view (unless you run mod_perl). You can only really tell the performance impact by installing the plugin and by measuring the performance with and without the new plugin, on real data.

If you need to install an "expensive" plugin, but you only need its functionality only in a subset of your data, you can disable it elsewhere by defining the %DISABLEDPLUGINS% setting.
Define
DISABLEDPLUGINS to be a comma-separated list of names of plugins to disable. Define it in Main.SitePreferences to disable those plugins everywhere, in the WebPreferences topic to disable them in an individual web, or in a topic to disable them in that topic. For example,
* Set DISABLEDPLUGINS = SpreadSheetPlugin, EditTablePlugin
Managing Installed Plugins
Some plugins require additional settings or offer extra options that you have to select. Also, you may want to make a plugin available only in certain webs, or temporarily disable it. And may want to list all available plugins in certain topics. You can handle all of these management tasks with simple procedures:
Listing Active Plugins
Plugin status macros let you list all active plugins wherever needed.
This site is running Foswiki version
Foswiki-1.0.7, Sun, 20 Sep 2009, build 5062, plugin API version
2.0
-
%ACTIVATEDPLUGINS% - shows the activated plugins
-
%PLUGINVERSION% - shows the plugins API version
-
%FAILEDPLUGINS% - shows what plugins failed, and why
Enabling Plugins
Plugins can be enabled and disabled with the
configure script. An installed plugin needs to be enabled before it can be used.
Plugin Evaluation Order
By default, plugins are executed in alphabetical order on plugin name. It is possible to change the order, for example to evaluate database macros before the spreadsheet CALCs. This can be done with
{PluginsOrder} in the plugins section of
configure.
Plugin-Specific Settings
Some plugins are configured with plugin
preference settings, newer plugins with
configure settings.
configure settings are accessible though the
configure interface.
Plugin
preference settings are defined in the plugin topic and can be overloaded. The SHORTDESCRIPTION setting is always present, it is needed for the automation in the extensions repository. Example preference settings defined in the
TablePlugin topic:
-
Set SHORTDESCRIPTION = Control attributes of tables and sorting of table columns
PreferenceSettings of active plugins can be retrieved anywhere in Foswiki with
%<pluginname>_<var>%, such as
%TABLEPLUGIN_SHORTDESCRIPTION%. They can also be redefined with the
%<pluginname>_<var>% setting at a lower level in the
SitePreferences or at the web level. For an easier upgrade it is recommended to customize plugin preference settings in Main.SitePreferences only.
Installing Plugins
Each Foswiki plugin comes with its own documentation: step-by-step installation instructions, a detailed description of any special requirements, version details, and a working example for testing. Many plugins have an install script that automates these steps for you.
Special Requirements: Some plugins need certain Perl modules to be preinstalled on the host system. Plugins may also use other resources, like graphics, other modules, applications, and templates. You should be able to find detailed instructions in the plugin's documentation.
Each plugin has a standard release topic, located in the
Foswiki:Extensions web at Foswiki.org. There's usually a number of other related topics, such as a developers page, and an appraisal page.
On-Site Pretesting
The recommended approach to testing new plugins before making them public is to create a second local Foswiki installation, and test the plugin there. You can allow selected users access to the test area. Once you are satisfied that it won't compromise your main installation, you can install it there as well.
The
Plugins page shows which plugins are: 1) installed, 2) loading properly, and 3) what plugin handlers they invoke. Any failures are shown in the Errors section. The
%FAILEDPLUGINS% macro can be used to debug failures. You may also want to check your webserver error log and the various Foswiki log files.
Some Notes on Plugin Performance
The performance of the system depends to some extent on the number of plugins installed and on the plugin implementation. Some plugins impose no measurable performance decrease, some do. For example, a Plugin might use many Perl libraries that need to be initialized with each page view (unless you run mod_perl). You can only really tell the performance impact by installing the plugin and by measuring the performance with and without the new plugin, on real data.

If you need to install an "expensive" plugin, but you only need its functionality only in a subset of your data, you can disable it elsewhere by defining the %DISABLEDPLUGINS% setting.
Define
DISABLEDPLUGINS to be a comma-separated list of names of plugins to disable. Define it in Main.SitePreferences to disable those plugins everywhere, in the WebPreferences topic to disable them in an individual web, or in a topic to disable them in that topic. For example,
* Set DISABLEDPLUGINS = SpreadSheetPlugin, EditTablePlugin
The Foswiki Perl Application Programming Interface
DevelopingPlugins provides a simple introduction to hooking into Foswiki code from your own Perl modules.
Foswiki:Development.GettingStarted is the starting point for more comprehensive documentation.
Related Topics: DeveloperDocumentationCategory,
AdminDocumentationCategory
