1 [[!template id=plugin name=conditional core=1 author="[[Joey]]"]]
4 With this plugin, you can make text be conditionally displayed on a page.
7 \[[if test="enabled(smiley)"
8 then="The smiley plugin is enabled :-)"
9 else="No smiley plugin here.."]]
11 If the specified `test` succeeds, the `then` text will be displayed,
12 otherwise the `else` text will be displayed. The `else` part is optional.
14 The `then` and `else` values can include any markup that would be allowed
15 in the wiki page outside the template. Triple-quoting the values even allows
16 quotes to be included.
18 The `test` is a [[ikiwiki/PageSpec]]; if it matches any page in the wiki
19 then it succeeds. So you can do things like testing for the existence of a
20 page or pages, testing to see if any pages were created in a given month,
23 If you want the [[ikiwiki/PageSpec]] to only match against the page that
24 contains the conditional, rather than matching against all pages in the
25 wiki, set the "all" parameter to "no".
27 The regular [[ikiwiki/PageSpec]] syntax is expanded with the following
32 Tests whether the specified plugin is enabled.
36 Tests whether the glob matches the name of the page that contains the
41 Tests whether the glob matches the name of the page that is being built.
42 That might be different than the name of the page that contains the
43 conditional, if it's being inlined into another page.
47 Tests whether the page is being included onto another page.