create new tag
, view all tags

Implemented: PLUGINVERSION Variable

The %PLUGINVERSION{}% variable returns the $TWiki::Plugins::VERSION number if no parameter is specified, or the version number of a named Plugin. If the Plugin cannot be found or is not active, 0 is returned.

The %PLUGINVERSION{"AnyPluginName"}% can be used for conditional rendering based on a Plugin version. This can be done for example with the $IF() function of the SpreadSheetPlugin.


You type Sample output Renders as
%PLUGINVERSION{}% 1.025 6.00
%PLUGINVERSION{"EmptyPlugin"}% 0 0
%PLUGINVERSION{"DefaultPlugin"}% 1.021 0
%PLUGINVERSION{"SpreadSheetPlugin"}% 1.013 $Rev: 28085 (2014-09-23) $
%PLUGINVERSION{"TablePlugin"}% 1.013 $Rev: 26425 (2013-10-14) $

-- PeterThoeny - 14 Aug 2004
-- MartinCleaver - 09 Aug 2004


Would be useful for $TWiki::Plugins::VERSION to be visible through the wiki - TWikiReleaseTrackerPlugin has to otherwise get the user to specify manually.

-- MartinCleaver - 09 Aug 2004

Useful, yes, and simple to do.

What is a good variable name? I do not want to pollute the TWiki variable namespace too much. How about a generic TWiki system variable that eventually understands several options? That is also better for performance since the system variable needs to be evaluated just once. Examples:

  • %TWIKISYSTEM{"$pluginsversion"}% -- returns version number of $TWiki::Plugins::VERSION
  • %TWIKISYSTEM{"$twikiversion"}% -- returns what %WIKIVERSION% contains; the latter being retired as an deprecated and undocumented variable
  • %TWIKISYSTEM{"$serveros"}% -- returns the server OS
  • %TWIKISYSTEM{"TWiki version $twikiversion: Plugins API versions: $pluginsversion"}% -- can be combined


-- PeterThoeny - 10 Aug 2004

Hmm, on the other hand, once we have ContentAccessSyntax in place, %TWIKISYSTEM{}% is kind of obsolete. So just for this need here, should we add a %PLUGINVERSION%, which returns $TWiki::Plugins::VERSION?

-- PeterThoeny - 11 Aug 2004

This discussion started in TWikiDistributionVariable.

I changed the syntax to %PLUGINVERSION{}% and added support to query the version of installed Plugins.

Feature is implemented; in SVN; and documented in TWikiVariables.

-- PeterThoeny - 14 Aug 2004

Topic revision: r1 - 2004-08-14 - PeterThoeny
  • 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.