Template:Counter: Difference between revisions

From Illerai
Jump to navigation Jump to search
illerai>Joeytje50
add named counters in 1st parameter and an optional reset parameter that will reset the counter to 1 again.
 
m 1 revision imported
 
(No difference)

Latest revision as of 21:48, 2 November 2024

Template documentation
This documentation is transcluded from Template:Counter/doc. [edit] [history] [purge]

This template serves one function, which is to keep track of a counter on the page. Keep in mind that using ordered lists (starting a line of text with a #) is likely preferable over using this template in many situations.

The template takes an optional first parameter that specifies the (case-sensitive) counter name. This allows multiple parallel counters to be used on a single page. The default counter name is 0.

The template also takes a reset parameter which, when set to anything but no, will reset the counter. If this parameter is omitted this does not happen.

Example

<poem>
{{Counter}} {{Counter}} {{Counter}},
it's easy as {{Counter|reset=yes}} {{Counter}} {{Counter}},
as simple as {{Counter|foo}} {{Counter|foo}} {{Counter|foo}}.
That's how easy counters can be.
Limitless (even more than {{Counter}}{{Counter|foo}}{{Counter|Foo}}) possibilities!
</poem>

1 2 3,
it's easy as 1 2 3,
as simple as 1 2 3.
That's how easy counters can be.
Limitless (even more than 141) possibilities!

Simple counter template. Simply increments the value it had the previous time it got inserted onto the page. Takes an optional parameter specifying the counter name.

Template parameters

ParameterDescriptionTypeStatus
Counter name1

The specific counter to use.

Default
0
Example
bosses
Stringoptional
Resetreset

Reset the specified counter and start counting back at 1.

Default
no
Example
yes
Booleanoptional