Template:IfMatch: Difference between revisions

From Elanthipedia
Jump to navigation Jump to search
mNo edit summary
(Add custom error messages)
Line 1: Line 1:
<includeonly>
{{#switch: {{lc:{{{1}}} }}
|{{lc:{{{2}}}}}
|{{lc:{{{3}}}}}
|{{lc:{{{4}}}}}
|{{lc:{{{5}}}}}
|{{lc:{{{6}}}}}
|{{lc:{{{7}}}}}
|{{lc:{{{8}}}}}
|{{lc:{{{9}}}}}
|{{lc:{{{10}}}}}
|{{lc:{{{11}}}}} = 1
|{{#If:{{{error|}}}
|{{{error}}}
}}

}}
</includeonly>
<noinclude>
<noinclude>
==Usage Documentation==
This template will accept one variable which it will compare to up to 10 other variables. If any of them match the first, it will return "1".<br>
This template will accept one variable which it will compare to up to 10 other variables. If any of them match the first, it will return "1".<br>
<b>Note:</b> The match is case insensitive.
<b>Note:</b> The match is case insensitive.

By specifying <nowiki>|error=</nowiki> a custom error message may be returned on no match.
==Syntax==
<pre>
<pre>
{{IfMatch | matchstring | variable1 | variable2 | .... | variable10}}
{{IfMatch | matchstring | variable1 | variable2 | .... | variable10}}

Additional options:
|error=
</pre>
</pre>
[[Category:Templates|{{PAGENAME}}]]
[[Category:Templates|{{PAGENAME}}]]
[[Category:Templates for Templates|{{PAGENAME}}]]
[[Category:Templates for Templates|{{PAGENAME}}]]
</noinclude>
</noinclude>
<includeonly>
{{#switch: {{lc:{{{1}}} }}
| {{lc:{{{2}}}}}
| {{lc:{{{3}}}}}
| {{lc:{{{4}}}}}
| {{lc:{{{5}}}}}
| {{lc:{{{6}}}}}
| {{lc:{{{7}}}}}
| {{lc:{{{8}}}}}
| {{lc:{{{9}}}}}
| {{lc:{{{10}}}}}
| {{lc:{{{11}}}}} = 1
}}
</includeonly>

Revision as of 13:10, 22 April 2008


Usage Documentation

This template will accept one variable which it will compare to up to 10 other variables. If any of them match the first, it will return "1".
Note: The match is case insensitive.

By specifying |error= a custom error message may be returned on no match.

Syntax

{{IfMatch | matchstring | variable1 | variable2 | .... | variable10}}

Additional options:
|error=