Help:ParserFunctions: Difference between revisions
Content deleted Content added
→if: Example |
|||
Line 49:
An example:
<nowiki> {{Template|Parameter=something}} {{Template}}</nowiki>
<nowiki> | |</nowiki>
<nowiki> | |</nowiki>
<nowiki>{{ #if: {{{parameter|}}} | Parameter is defined. | Parameter is undefined. }}</nowiki>
Note that the <tt>if</tt> function does '''not''' support "=" signs or mathematical expressions. <nowiki>{{#if: 1 = 2|yes|no}}</nowiki> will return "yes", because the string "1 = 2" is not blank. It is intended as an "if defined" structure. To compare strings, use <tt>ifeq</tt>. To compare numbers, use <tt>ifexpr</tt>.
|