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 hcount: Difference between revisions

From HR Wiki Twice
Jump to navigationJump to search
imported>HRWikiMirrorBot
Imported from hrwiki.org via Wayback Machine (HTML→wikitext)
 
imported>HRWikiMirrorBot
Reimported from hrwiki.org Wayback HTML→wikitext (full reconvert)
 
Line 1: Line 1:
<!-- Mirrored from Homestar Runner Wiki (hrwiki.org) via Wayback Machine; HTML converted to wikitext. Formatting may be imperfect. -->
<!-- Mirrored from Homestar Runner Wiki (hrwiki.org) via Wayback Machine -->
<span style="display:none">1</span> This template is for adding a hidden count meant for use in a [[HRWiki:SORT|sortable table]].
1
This template is for adding a hidden count meant for use in a [[HRWiki:SORT|sortable table]].


'''Usage:'''
'''Usage:'''


<code>{{ hcount | </code>''<code>countername</code>''<code> }}</code>
{{ 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''):
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>{{ hcount | </code>''<code>countername</code>''<code> [ | </code>''<code>increment</code>''<code> ] }}</code>
{{ hcount | ''countername'' [ | ''increment'' ] }}


'''IMPORTANT:'''
'''IMPORTANT:'''


Please be sure to first reset the counter using the {{[[Template:hresetcount|hresetcount]]}} template before making any calls to this template in order for this process to work correctly. Since sortable tables sort values [[Lexicographic order|lexicographically]], regular numbers are sorted incorrectly. To get around this limitation the template will initialize the hidden counter to 10,000. The general syntax to reset the counter is:
Please be sure to first reset the counter using the {{[[Template:hresetcount|hresetcount]]}} template before making any calls to this template in order for this process to work correctly. Since sortable tables sort values [[Lexicographic order|lexicographically]], regular numbers are sorted incorrectly. To get around this limitation the template will initialize the hidden counter to 10,000. The general syntax to reset the counter is:


<code>{{[[Template:hresetcount|hresetcount]] | </code>''<code>countername</code>''<code>}}</code>
{{[[Template:hresetcount|hresetcount]] | ''countername''}}


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


<code>{{[[Template:hresetcount|hresetcount]] | </code>''<code>countername1</code>''<code> [ |</code>''<code>countername2</code>''<code> ] [ | </code>''<code>countername3</code>''<code> ] [ |</code>''<code>countername4</code>''<code> ] [ |</code>''<code>countername5</code>''<code> ] [ |</code>''<code>countername6</code>''<code> ] }}</code>
{{[[Template:hresetcount|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 in order for lexicographical order to line up with numerical order.'') :
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 in order for lexicographical order to line up with numerical order.'') :


<code>{{[[Template:hresetcount|hresetcount]] | </code>''<code>countername</code>''<code> | v=9999 | countby=-1 }}</code>
{{[[Template:hresetcount|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). Note that both parameters apply to ''all'' counters included in the {{[[Template:hresetcount|hresetcount]]}} template.
This resets the hidden counter to a value of 9,999 (once the proper increment of -1 is applied when calling the counter). Note that both parameters apply to ''all'' counters included in the {{[[Template:hresetcount|hresetcount]]}} template.


'''Technical Information:'''
'''Technical Information:'''


* The counter in '''hcount''' is separate from that of '''vcount'''. The '''vcount''' template appends &quot;_visible&quot; to the counter name specified in the first parameter.
* The counter in '''hcount''' is separate from that of '''vcount'''. The '''vcount''' template appends "_visible" to the counter name specified in the first parameter.


<span id="see-also"></span>
==== See Also ====
==== <span class="mw-headline">See Also</span> ====


* [[HRWiki:Counter|Counter function usage]]
* [[HRWiki:Counter|Counter function usage]]
* {{[[Template:vcount|vcount]]}}
* {{[[Template:vcount|vcount]]}}
 
[[Category:Counter Formatting Templates]]
<div id="catlinks" class="catlinks">
 
<div id="mw-normal-catlinks">
 
[/wiki/Special:Categories Category]: <span dir="ltr">[[Category:Counter Formatting Templates|Counter Formatting Templates]]</span>
 
</div>
 
</div>



Latest revision as of 14:24, 14 July 2026

1 This template is for adding a hidden count meant for use in a sortable table.

Usage:

Template:Hcount

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):

Template:Hcount

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. Since sortable tables sort values lexicographically, regular numbers are sorted incorrectly. To get around this limitation the template will initialize the hidden counter to 10,000. The general syntax to reset the counter is:

{{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 in order for lexicographical order to line up with numerical order.) :

{{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). Note that both parameters apply to all counters included in the {{hresetcount}} template.

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