Template:or else
Appearance
- The following documentation is located at Template:or else/documentation. [edit]
- Useful links: subpage list • links • redirects • transclusions • errors (parser/module) • sandbox
Usage
{{or else|VAL1|VAL2}}
is equivalent to {{#if:VAL1|VAL1|VAL2}}
.
You should generally use a construct like {{or else|{{{param|}}}|default value}}
in preference to {{{param|default value}}}
. The former will substitute the default value when the parameter is either empty or undefined, while the latter will only substitute the default value when the parameter is undefined. Attempting to pass an undefined parameter to a subtemplate will convert it to an empty parameter, and code that distinguishes between undefined and empty parameters will then fail.