See something you'd like to change or add, but you've never edited an open encyclopædia before? This overview was written to help absolute beginners get started.

Template:2 if 1

From A Storehouse of Knowledge

Jump to: navigation, search

Template: 2 if 1
Use on Templates
Use for Returns parameter 2 if parameter 1 is non-blank
Category template applies to page (none)
Template Parameters
(See Template style manual).
NamePurposeRequired?SMW propertyComment
1The test valueno
2The value to returnno

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 {{2 if 1 | {{{a|}}} | [[{{{a}}}]] }}:
  • If parameter a = train, then the template will return [[train]].
  • If parameter a is blank, then the template will return nothing.
Personal tools
visitor navigation