Difference between revisions of "Template:If"
From SimsWiki
EllaCharm3d (Talk | contribs) |
EllaCharm3d (Talk | contribs) |
||
Line 1: | Line 1: | ||
{{{else{{{test|}}}|{{{test{{{test|}}}|{{{then|}}}}}}}}}<noinclude>== Usage == | {{{else{{{test|}}}|{{{test{{{test|}}}|{{{then|}}}}}}}}}<noinclude>== Usage == | ||
− | <pre> | + | |
− | {{if | + | <pre>{{if |
|test=VARIABLE_OR_PARAMETER_TO_TEST | |test=VARIABLE_OR_PARAMETER_TO_TEST | ||
|then=code if 'test' is not empty | |then=code if 'test' is not empty | ||
|else=code if 'test' is empty | |else=code if 'test' is empty | ||
− | }} | + | }}</pre> |
− | </pre> | + | |
Parameter '''else''' is optional. So you may also do: | Parameter '''else''' is optional. So you may also do: | ||
− | <pre> | + | <pre>{{if |
− | {{if | + | |
|test=VARIABLE_OR_PARAMETER_TO_TEST | |test=VARIABLE_OR_PARAMETER_TO_TEST | ||
|then=code if 'test' is not empty | |then=code if 'test' is not empty | ||
− | }} | + | }}</pre>[[Category: Templates]]</noinclude> |
− | </pre | + | |
− | + |
Latest revision as of 12:21, 29 October 2012
Usage
{{if |test=VARIABLE_OR_PARAMETER_TO_TEST |then=code if 'test' is not empty |else=code if 'test' is empty }}
Parameter else is optional. So you may also do:
{{if |test=VARIABLE_OR_PARAMETER_TO_TEST |then=code if 'test' is not empty }}