DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:variants

This is an old revision of the document!


variants Plugin

Compatible with DokuWiki

Adora Belle

plugin Allows to create different variants of a page that the user can select

Last updated on
2013-02-06
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 arguments, condition

Tagged with condition, if

This plugin allows to create variants of page that can be switched depending on a URL parameter or in later versions also a value that is stored in the session.

The parts that shall be different for the different variants can be specified using an if/else conditional syntax that can be nested and repeated in order to offer maximum flexibility.

Inside the syntax all kinds of other syntax can be used, though there could be problems/unwanted behaviors in certain cases.

:!: This is still an early version of the plugin with a minimum set of features.

Installation

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

Examples/Usage

<ifvar foo=bar>
foo equals bar!
<else>
foo doesn't equal bar!
</ifvar>

Syntax

<ifvar [key][!]=[value]>...[<else>...]</ifvar>
  • [key] is the key that shall be used in the URL/session (in later versions)
  • [value] is the value the value from the URL/session shall be checked against. If != is used, it is checked if the value does not equal the value from the URL/session.
  • An optional else branch can be specified that is shown when the condition is not met

Change Log

ToDo/Wish List

  • Instead of a URL parameter store the choice in the session and offer a syntax that allows the user to view/set this choice
  • Support larger/greater comparisons instead of just simple equals/doesn't equal tests

Discussion

Please report bugs and feature requests in the issue tracker.

plugin/variants.1360193463.txt.gz · Last modified: 2013-02-07 00:31 by Michitux

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