TWiki home TWiki > Plugins > ConditionalPlugin TWiki webs:
Main | TWiki | Plugins | Sandbox | Patterns
Plugins . { Home | Changes | Index | Search | Go }

ConditionalPlugin

This is an alpha version and is still under development. See ConditionalPluginDev? for discussion. This plugin adds the ability to do simple, not nested, conditional rendering in topics. It attempts to do this in a relatively secure manner by applying the following security measures: More sophisticated constructs (like support for range-conditions or nested constructs) may appear in future revisions, if and when the need for them arises.

Syntax Rules

Examples

The following example prints something dependent on the topicname (can be usefull in templates) Result * %IF{ ConditionalPlugin eq Home }% This is the Home topic %ELSE% This is NOT the Home topic %ENDIF% A different approach, without the 'else' clause: * This is %IF{ %TOPIC% ne Home }% NOT %ENDIF% the Home topic Which of course als results in: Or: Which results in:

ConditionalPlugin Global Settings

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

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

Plugin Info

Plugin Author: JeroenVanDongen?
Plugin Version: 10 Aug 2002 (V1.000)
Change History:  
10 Aug 2002: Initial version
10 Aug 2002: Improved regexp to deal with multi-line constructs
11 Aug 2002: Added lazy-loading for Safe.pm
CPAN Dependencies: none
Other Dependencies: Safe.pm (part of Perl 5.005_3 and up
Perl Version: 5.005
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/ConditionalPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ConditionalPluginDev
Related Topics: TWikiPreferences, TWikiPlugins

-- JeroenVanDongen? - 10 Aug 2002

Topic ConditionalPlugin . { Edit | Attach | Ref-By | Printable | Diffs | r1.2 | > | r1.1 | More }
Revision r1.2 - 27 Jan 2003 - 22:03 GMT - ArthurClemens
Parents: Home
Copyright © 2003 by the contributing authors. All material on this collaboration tool is the property of the contributing authors. Ideas, requests, problems regarding TWiki? Send feedback