3,554
edits
(Created template) |
No edit summary |
||
Line 1: | Line 1: | ||
<span class="_toggler- | <span class="_togglegroup _toggle_initshow _toggle _toggler toggle-visible" style="display:none;">{{{show|[show]}}}</span><span class="_toggle_inithide _toggle _toggler toggle-hidden" style="display:none;">{{{hide|[hide]}}}</span><div class="_toggle_inithide _toggle toggle-hidden">{{{content|{{{1}}}}}}</div><noinclude> | ||
==Purpose== | ==Purpose== | ||
This template handles switching between two displayed items | This template handles switching between two displayed items. | ||
==Usage== | ==Usage== | ||
To use this template, use either the standard format {{Desc|Normal| | To use this template, use either the standard format {{Desc|Normal|content}} | ||
or the named parameter format: | or the named parameter format: | ||
<div style="float:left; margin-right:20px"><pre> | <div style="float:left; margin-right:20px"><pre> | ||
{{ | {{Switch | ||
|show= | |show= | ||
|hide= | |hide= | ||
|content= | |||
}} | }} | ||
</pre></div> | </pre></div> | ||
{{Parameter|show|This specifies the text of the link that shows the content that is initially hidden.|Optional|[show]}} | {{Parameter|show|This specifies the text of the link that shows the content that is initially hidden.|Optional|[show]}} | ||
{{Parameter|hide|This specifies the text of the link that switches the content back to what was initially displayed.|Optional|[hide]}} | {{Parameter|hide|This specifies the text of the link that switches the content back to what was initially displayed.|Optional|[hide]}} | ||
{{Parameter|content|This specifies the content you want to be able to switch|Optional}} | |||
{{clear}} | {{clear}} | ||
==Example== | ==Example== | ||
To use this to set up a traditional show-type template that has nothing initially displayed, use something like the following: | To use this to set up a traditional show-type template that has nothing initially displayed, use something like the following: | ||
<pre> | <pre> | ||
{{switch| | {{switch|content=This is hidden text.}} | ||
</pre> | </pre> | ||
This results in: | This results in: | ||
{{switch| | {{switch|content=This is hidden text.}} | ||
{{ | |||
Alternatively: | |||
<pre> | |||
{{switch|This is hidden text.}} | |||
</pre> | |||
This results in: | |||
{{switch|This is hidden text.}} | |||
To make the opposite effect, use the following: | To make the opposite effect, use the following: | ||
<pre> | <pre> | ||
{{switch|id=exampleB|show=[hide]|hide=[show] | {{switch|id=exampleB|show=[hide]|hide=[show]|content=This text can be hidden.}} | ||
</pre> | </pre> | ||
This results in: | This results in: | ||
{{switch|id=exampleB|show=[hide]|hide=[show] | {{switch|id=exampleB|show=[hide]|hide=[show]|content=This text can be hidden.}} | ||
{{Cat|Formatting Templates}}</noinclude> | {{Cat|Formatting Templates}}</noinclude> |