Difference between revisions of "Template:2if1"
Jump to navigation
Jump to search
m (Unprotected "Template:2if1": iduan to work) |
m (noinclude must surround the category unless one wants every page this template is on to be in that category) |
||
| Line 12: | Line 12: | ||
:* If parameter {{tt|a}}={{tt|train}}, then the template will return {{tt|<nowiki>[[train]]</nowiki>}}. | :* If parameter {{tt|a}}={{tt|train}}, then the template will return {{tt|<nowiki>[[train]]</nowiki>}}. | ||
:* If parameter {{tt|a}} is blank, then the template will return nothing. | :* If parameter {{tt|a}} is blank, then the template will return nothing. | ||
| + | [[Category:Navigation box]] | ||
</noinclude> | </noinclude> | ||
| − | |||
Revision as of 00:10, February 17, 2009
| Template: 2if1 | |
|---|---|
| Use on | Templates |
| Use for | Returns parameter 2 if parameter 1 is non-blank |
| Category template applies to page | (none) |
| Template Parameters (See using templates). | |||
|---|---|---|---|
| Name | Purpose | Required? | Comment |
| 1 | The test value | no | |
| 2 | The value to return | no | |
This template returns parameter 2 only if parameter 1 is not blank. The main use of this is in other templates, in converting parameters.
Example:
- Given {{2if1 | {{{a|}}} | [[{{{a}}}]] }}:
- If parameter a=train, then the template will return [[train]].
- If parameter a is blank, then the template will return nothing.