Template:vcount

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
(adding sort info link)
(expand instructions to cover visible value)
Line 13: Line 13:
Please be sure to first reset the counter before making any calls to this template in order to a sufficiently high enough by using the {{tl|hresetcount}} template:
Please be sure to first reset the counter before making any calls to this template in order to a sufficiently high enough by using the {{tl|hresetcount}} template:
:<code><nowiki>{{</nowiki>[[Template:hresetcount|hresetcount]] | ''countername''}}</code>
:<code><nowiki>{{</nowiki>[[Template:hresetcount|hresetcount]] | ''countername''}}</code>
-
This ensures that the table is sorted correctly (in proper numerical order). For more information on using {{tl|hresetcount}} please read the documentation for {{tl|hcount}}.
+
This ensures that the table is sorted correctly (in proper numerical order). You may also reset up to '''6''' counters with the {{tl|hresetcount}} template. (''Note that brackets denote optional parameters''):
 +
:<code><nowiki>{{</nowiki>[[Template:hresetcount|hresetcount]] | ''countername1'' [ |''countername2'' ] [ | ''countername3'' ] [ |''countername4'' ] [ |''countername5'' ] [ |''countername6'' ] }}</code>
 +
Optionally, you may set the initial value to something other than the default value of 10,000. (''However, this is not recommended and in most cases, unnecessary.'') In addition, you can set the visible value to something other than the default value of 1:
 +
:<code><nowiki>{{</nowiki>[[Template:hresetcount|hresetcount]] | ''countername''  | v=100000 | vv=10 }}</code>
 +
This resets the counter to a value of 100,000 and the first visible value to 10.
'''Technical Information:'''
'''Technical Information:'''

Revision as of 22:52, 15 October 2007

11


Template that augments the counter parser function so that its output can be part of a sorted table.

Usage:

{{ vcount | countername }}

where countername is the name of the counter being used. Place this template in each cell of a given column. The usage of this tempalte is similar to that of {{hcount}} although the extended functionality of #count is also available (and note that brackets denote optional parameters):

{{ vcount | countername [ | initial value ] [ | increment ] }}

IMPORTANT:

Please be sure to first reset the counter before making any calls to this template in order to a sufficiently high enough by using the {{hresetcount}} template:

{{hresetcount | countername}}

This ensures that the table is sorted correctly (in proper numerical order). You may also reset up to 6 counters with the {{hresetcount}} template. (Note that brackets denote optional parameters):

{{hresetcount | countername1 [ |countername2 ] [ | countername3 ] [ |countername4 ] [ |countername5 ] [ |countername6 ] }}

Optionally, you may set the initial value to something other than the default value of 10,000. (However, this is not recommended and in most cases, unnecessary.) In addition, you can set the visible value to something other than the default value of 1:

{{hresetcount | countername | v=100000 | vv=10 }}

This resets the counter to a value of 100,000 and the first visible value to 10.

Technical Information:

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

See Also

Personal tools