Difference between revisions of "Template:Switch"

Jump to navigation Jump to search
213 bytes added ,  15:27, 5 March 2009
Add default functionality
(Document the usage)
(Add default functionality)
Line 1: Line 1:
<includeonly>{{{ {{{switch}}} }}}</includeonly><noinclude>
<includeonly>{{{ {{{switch|{{{default}}}}}} }}}</includeonly><noinclude>
=Usage=
=Usage=
Use the "switch" argument to select which argument to show:
Use the "switch" argument to select which argument to show:
Line 5: Line 5:
*<nowiki>{{{Switch|yes=yay|no=nay|switch=no}}}</nowiki> will show "nay"
*<nowiki>{{{Switch|yes=yay|no=nay|switch=no}}}</nowiki> will show "nay"
</noinclude>
</noinclude>
The "default" argument will be used when the "switch" value doesn't match any of the options or that's empty:
*<nowiki>{{{Switch|yes=yay|no=nay|default=maybe|switch=err}}}</nowiki> will show "maybe"
960

edits

Navigation menu