Template:IfMatch: Difference between revisions

From Elanthipedia
Jump to navigation Jump to search
(Add custom error messages)
mNo edit summary
Line 10: Line 10:
|{{lc:{{{9}}}}}
|{{lc:{{{9}}}}}
|{{lc:{{{10}}}}}
|{{lc:{{{10}}}}}
|{{lc:{{{11}}}}} = 1
|{{lc:{{{11}}}}} = {{#If:{{{true|}}}|{{{true}}}|1}}
|{{#If:{{{error|}}}
|{{#If:{{{false|}}}
|{{{error}}}
|{{{false}}}
}}
}}
Line 23: Line 23:
<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.
By specifying <nowiki>|true= and |false=</nowiki> a custom strings may be returned on match and no match.
==Syntax==
==Syntax==
<pre>
<pre>
Line 29: Line 29:


Additional options:
Additional options:
|error=
|true=
|false=
</pre>
</pre>
[[Category:Templates|{{PAGENAME}}]]
[[Category:Templates|{{PAGENAME}}]]

Revision as of 14:57, 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 |true= and |false= a custom strings may be returned on match and no match.

Syntax

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

Additional options:
|true=
|false=