DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:showif

This is an old revision of the document!


showif plugin

Compatible with DokuWiki

Weatherwax, Adora Belle, Angua, Rincewind

plugin Shows some text of a page only if a list of conditions is true

Last updated on
2013-10-17
Provides
Syntax
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to condition, ifauth, ifauthex, isauth, nodisp

Tagged with acl, hide, text

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 ;-)

Discussion

Known Bugs and Issues

This Plugin dosn't work in the sidebar from the DokuWiki default template.

Any plans to change this? I would be happy because I would need this function. 2014/01/20 cit
plugin/showif.1390232117.txt.gz · Last modified: 2014-01-20 16:35 by 152.96.140.94

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki