This is an old revision of the document!
Table of Contents
showif plugin
Compatible with DokuWiki
Weatherwax, Adora Belle, Angua, Rincewind
Description
Shows some text of a page only if a list of conditions is true.
Can hide sections.
Lazy hiding based on plugin nodisp from Myron Turner.
This plugin is particularly useful in open Wikis with closed sections.
Installation
Install the plugin using the Plugin Manager and the download URL above, which points to the latest version of the plugin. Refer to Plugins on how to install plugins manually.
Examples/Usage
Example 1:
Show some welcoming text for users of a public page that are not yet logged in.
<showif isloggedin> You may now explore the rest of the site. </showif> <showif isnotloggedin> Please log in to view the rest of the site. </showif>
Example 2:
Show a direct upload link if the user may edit:
<showif mayedit> [[http://[yourwiki]/lib/exe/mediamanager.php?ns=:[yournamespace]:|Upload MP3-files]] </showif>
Syntax
Basic syntax:
<showif [condition1], [condition2], ...>[text]</showif>
- condition can be:
- isloggedin
- isnotloggedin
- mayonlyread
- mayatleastread
- mayedit
- isadmin
Conditions may be a comma-separated list, all conditions have to be true to show [text].
Not all combinations make sense