Template:hcount
From Homestar Runner Wiki
(fix doc to new template) |
It's dot com (Talk | contribs) (document second parameter and countby) |
||
(includes 14 intermediate revisions) | |||
Line 1: | Line 1: | ||
- | <span style="display:none">{{#count:{{{1}}}}}</span><noinclude> | + | <span style="display:none">{{#count:{{{1}}}|{{{2|1}}}}}</span><noinclude> |
- | This template is for adding a hidden count meant for use in a sortable table. | + | This template is for adding a hidden count meant for use in a [[HRW:SORT|sortable table]]. |
- | Usage: | + | |
+ | '''Usage:''' | ||
:<code><nowiki>{{ </nowiki> hcount | ''countername'' }}</code> | :<code><nowiki>{{ </nowiki> hcount | ''countername'' }}</code> | ||
- | where ''countername'' is the name of the counter being used. Place this template | + | where ''countername'' is the name of the counter being used. '''''This parameter is required.''''' Place this template at the beginning of each cell of a given column. You can specify custom increment values for the counter (''note that brackets denote optional parameters''): |
+ | |||
+ | :<code><nowiki>{{ </nowiki> hcount | ''countername'' [ | ''increment'' ] }}</code> | ||
'''IMPORTANT:''' | '''IMPORTANT:''' | ||
- | Please be sure to first reset the counter before making any calls to this template in order to a sufficiently high enough | + | 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: | + | :<code><nowiki>{{</nowiki>[[Template:hresetcount|hresetcount]] | ''countername''}}</code> |
- | This ensures that the table is sorted correctly (in proper numerical order). | + | 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 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. (''It is recommended to use a value with all nines if counting by a negative value.'') : | ||
+ | :<code><nowiki>{{</nowiki>[[Template:hresetcount|hresetcount]] | ''countername'' | v=9999 | countby=-1 }}</code> | ||
+ | This resets the hidden counter to a value of 9,999 (once the proper increment of -1 is applied when calling the counter). | ||
+ | |||
+ | '''Technical Information:''' | ||
+ | * The counter in '''hcount''' is separate from that of '''vcount'''. The '''vcount''' template appends "_visible" to the counter name specified in the first parameter. | ||
====See Also==== | ====See Also==== | ||
*[[HRWiki:Counter|Counter function usage]] | *[[HRWiki:Counter|Counter function usage]] | ||
- | [[Category:Formatting Templates|{{PAGENAME}}]] | + | *{{tl|vcount}} |
+ | [[Category:Counter Formatting Templates|{{PAGENAME}}]] | ||
</noinclude> | </noinclude> |
Current revision as of 16:52, 4 February 2021
This template is for adding a hidden count meant for use in aUsage:
{{ hcount | countername }}
where countername is the name of the counter being used. This parameter is required. Place this template at the beginning of each cell of a given column. You can specify custom increment values for the counter (note that brackets denote optional parameters):
{{ hcount | countername [ | 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 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. (It is recommended to use a value with all nines if counting by a negative value.) :
{{hresetcount | countername | v=9999 | countby=-1 }}
This resets the hidden counter to a value of 9,999 (once the proper increment of -1 is applied when calling the counter).
Technical Information:
- The counter in hcount is separate from that of vcount. The vcount template appends "_visible" to the counter name specified in the first parameter.