Open main menu

Difference between revisions of "Template:Switch"

No change in size ,  15:38, 5 March 2009
m
Move all the documentation inside <noinclude>
(Add default functionality)
m (Move all the documentation inside <noinclude>)
Line 4: Line 4:
*<nowiki>{{{Switch|yes=yay|no=nay|switch=yes}}}</nowiki> will show "yay"
*<nowiki>{{{Switch|yes=yay|no=nay|switch=yes}}}</nowiki> will show "yay"
*<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>
The "default" argument will be used when the "switch" value doesn't match any of the options or that's empty:
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"
*<nowiki>{{{Switch|yes=yay|no=nay|default=maybe|switch=err}}}</nowiki> will show "maybe"
</noinclude>
960

edits