Counter#

A simple counter that starts counting at 1 at the top of the page, and each time it is invoked, will increase its value. These counters are transient, and relevant to the current page view only - i.e. two persons viewing the same page at the same time get their own counters.

The current counter value is accessible also as a WikiVariable. The name of the variable is "counter", or "counter-<name>", if you have defined a counter name.

Parameters#

  • name = counter name. You may define as many counters per page as you want; you just need to separate them with the counter name. This parameter is optional.
  • increment = value. (Since 2.8) The amount to increment the counter with, it may be both a positive and a negative value, the default is 1. The parameter is optional.
  • start = value (Since 2.8) The starting value of the count, the default value = 0. This parameter is optional.
  • showResult = true/false (Since 2.8) Can be true or false, and determines if the counter value should be visible on the page, the default is true. This parameter is optional.

Examples#

Specified value Result on page Comments
[{Counter}], [{Counter}], [{Counter}], [{Counter name='aa'}] 1, 2, 3, 1 The value of "counter" at the end is 3 and the value of "counter-aa" is 1.
[{$counter}], [{$counter-aa}] 3, 1access the counter value via the variable name (without increasing it)

Back to JSPWikiPlugins

Add new attachment

In order to upload a new attachment to this page, please use the following box to find the file, then click on “Upload”.
« This page (revision-5) was last changed on 08-Apr-2008 22:14 by 195.241.35.97