Difference between revisions of "Template:Switch"
Jump to navigation
Jump to search
m (Move all the documentation inside <noinclude>) |
m (Add general description) |
||
Line 1: | Line 1: | ||
<includeonly>{{{ {{{switch|{{{default}}}}}} }}}</includeonly><noinclude> | <includeonly>{{{ {{{switch|{{{default}}}}}} }}}</includeonly><noinclude> | ||
This template allows you to conditionally show one of a predefined set of arguments, depending on another named argument. | |||
=Usage= | =Usage= | ||
Use the "switch" argument to select which argument to show: | Use the "switch" argument to select which argument to show: |
Revision as of 15:48, 5 March 2009
This template allows you to conditionally show one of a predefined set of arguments, depending on another named argument.
Usage
Use the "switch" argument to select which argument to show:
- {{{Switch|yes=yay|no=nay|switch=yes}}} will show "yay"
- {{{Switch|yes=yay|no=nay|switch=no}}} will show "nay"
The "default" argument will be used when the "switch" value doesn't match any of the options or that's empty:
- {{{Switch|yes=yay|no=nay|default=maybe|switch=err}}} will show "maybe"