Difference between revisions of "Template:Ifeqall"
imported>Hornoir |
imported>Hornoir |
||
| Line 1: | Line 1: | ||
| − | {{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{1}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{2|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{3|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{4|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{5|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{6|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{7|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{8|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{9|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{10|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{11|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{12|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{13|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{14|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{15|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{16|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{17|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{18|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{19|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{20|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{21|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{22|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{23|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{24|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{25|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{26|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{27|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{28|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{29|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{30|}}}}}|{{{output}}}|{{{default|}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} | + | {{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{1}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{2|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{3|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{4|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{5|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{6|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{7|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{8|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{9|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{10|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{11|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{12|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{13|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{14|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{15|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{16|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{17|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{18|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{19|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{20|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{21|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{22|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{23|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{24|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{25|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{26|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{27|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{28|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{29|}}}}}|{{{output}}}|{{#ifeq:{{lc:{{{compare}}}}}|{{lc:{{{30|}}}}}|{{{output}}}|{{{default|}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}<noinclude> |
| + | {{documentation}} | ||
| + | <!-- Add categories and interwikis to the /doc subpage, not here! --> | ||
| + | </noinclude> | ||
Revision as of 12:55, 6 January 2009
The Template:Tf template extends the #ifeq: parser function, allowing it to pass multiple case strings against a single comparison string.
Usage
This meta-template compares if the comparison string (parameter compare) equals case string 1 and case string 2 and case string 3 (up to 10 unnamed numeric parameters) then returns a single result string (parameter output) if equal or returns a single optional default result string (parameter default) if not equal.
Parameters
- compare
- Required parameter. The comparison string against which all (up to 10) case strings will be compared with.
- output
- Required parameter. The result string which is outputted if the comparison string equals all of the inputted case strings.
- default
- The default result string which is outputted if the comparison string does not equal all of the inputted case strings.
Examples
Assume there is a WikiProject banner that should make sure all B-Class criteria on the checklist are checked before assigning the article as B-Class. By using...
{{ ifeqall | compare = yes | {{{B-Class-1|}}} | {{{B-Class-2|}}} | {{{B-Class-3|}}} | {{{B-Class-4|}}} | {{{B-Class-5|}}} |
output = B-Class | default = C-Class }}
...this template will check the compare value (i.e., yes) against all the case strings (i.e., {{{B-Class-1|}}}, {{{B-Class-2|}}}, {{{B-Class-3|}}}, {{{B-Class-4|}}}, {{{B-Class-5|}}}) and, if they are all equal, will return the output value (i.e., B-Class). If the compare value is not the same as all of the case strings, then it will return the default value (i.e., C-Class).
Please note: The comparison string and case strings are not case-sensitive, meaning it treats uppercase and lowercase letters as the same. The result string and default result string are case-sensitive and will be returned exactly as inputted.
Full blank syntax
{{ifeqall
| compare =
| output =
| default =
<!-- place up to 10 case strings beneath this line with a pipeline (|) before each -->
}}
See also
- {{ifeqany}}
- Compares up to 24 case strings against each other with result string and default result string outputs.
- {{ifequal}}
- Compares up to 16 comparison strings against an equal number of case strings.
- {{ifor}}
- Compares up to 30 comparison strings against an equal number of case strings with optional result string and default result string outputs.
| The above documentation is transcluded from Template:Ifeqall/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |