Work in progress — This wiki is an active migration / mirror of Homestar Runner Wiki and is not finished yet. Account registration and public editing are turned off until the migration is further along. For status updates, see the migration thread on the forums.

Template vcount

From HR Wiki Twice
Jump to navigationJump to search

1 1


Template that augments the counter parser function so that its output can be part of a sorted table. This template creates both a hidden counter (for correct sorting) and a visible counter for display.

Usage:

Template:Vcount

where countername is the name of the counter being used. This parameter is required. Place this template in each cell of a given column. You can specify custom increment values for the counter (note that brackets denote optional parameters):

Template:Vcount

IMPORTANT:

Please be sure to first reset the counter using the {{hresetcount}} template before making any calls to this template in order for this process to work correctly. Under the hood, this template also uses {{hcount}}. But here, two separate counters are initialized: a visible and a hidden counter. These values are incremented in lockstep, but the hidden counter is offset by 10,000 relative to the visible counter. Similarly, up to 6 pairs of counters may be initialized. See that template for more information.

Optionally, you may set the initial visible counter value to something other than the default value of 1:

{{hresetcount | countername | vv=25 }}

This resets the visible counter to 25 but the hidden counter is still initialized to 10,000. You can set the hidden counter value to something other than the default value of 10,000 and count by something other than the default value of 1 in the same call.

{{hresetcount | countername | v=9999 | vv=100 | countby=-1 }}

This resets the hidden counter to a value of 9,999 and the visible counter to a value of 100 (once the proper increment of -1 is applied when calling the template). Subsequent calls to this template will continue to decrease both counters by 1.

Technical Information:

  • vcount creates two separate counters, one for the hidden count, another for the visible count. Specifically, the template appends "_visible" to the counter name specified in the first parameter to create the visible counter (e.g. counter1 and counter1_visible).

See Also