Open main menu

Difference between revisions of "Template:Switch"

169 bytes added ,  19:18, 5 March 2009
Add documentation about the empty default (probably doesn't work well yet)
(Undo revision 10516 by Jvprat (Talk))
(Add documentation about the empty default (probably doesn't work well yet))
Line 9: Line 9:
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> shows "{{Switch|yes=yay|no=nay|default=maybe|switch=err}}"
*<nowiki>{{Switch|yes=yay|no=nay|default=maybe|switch=err}}</nowiki> shows "{{Switch|yes=yay|no=nay|default=maybe|switch=err}}"
The "default" argument is ignored when it's empty:
*<nowiki>{{Switch|yes=yay|no=nay|default=|switch=err}}</nowiki> shows "{{Switch|yes=yay|no=nay|default=|switch=err}}"
</noinclude>
</noinclude>
960

edits