More actions
*>Coppertwig new template |
*>Razorflame m Protected "Template:Parameter count": Highly visible template; used by over 1,700 pages; protecting to prevent tampering ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite)) |
(No difference)
|
Revision as of 20:55, 5 February 2009
Template to find number of parameters. For example, if the template is called with three parameters, like this: {{Parameter count|x|y|z}} then it shows "three". If there are no parameters, it shows "zero". If there are five or more, it shows "five". It only counts up to the first nonblank parameter, and ignores it and all parameters after it.
This template is used by the verb template.
Example usage:
{{#switch:{{Parameter count | {{{1| }}} | {{{2| }}} | {{{3| }}} | {{{4| }}} | {{{5| }}} }} |zero=text to be displayed for zero parameters |one=text to be displayed for one parameter |two=text to be displayed for two parameters |three=text to be displayed for three parameters |four=text to be displayed for four paramters |five=text to be displayed for five parameters |This text is never displayed; it only counts up to five.}}