Template:Hide: Difference between revisions

Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
313 bytes removed ,  January 16, 2012
no edit summary
(Created template)
 
No edit summary
Line 1: Line 1:
<span class="_toggler-{{{id|item}}}1 _toggler-{{{id|item}}}2">{{toggle|{{{show|[show]}}}|{{{hide|[hide]}}}|{{{id|item}}}2 {{{id|item}}}}}</span><noinclude>
<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. It's meant to be used in conjunction with [[Template:Content]] and will not function without it.
This template handles switching between two displayed items.


==Usage==
==Usage==
NOTE: This template <u>CANNOT</u> be used alone. It <u>MUST</u> be used in conjuction with the [[Template:Content|Content template]].


To use this template, use either the standard format {{Desc|Normal|ID|show|hide}}
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>
{{Content
{{Switch
|id=
|show=
|show=
|hide=
|hide=
|content=
}}
}}
</pre></div>
</pre></div>
{{Parameter|id|This is some one word name used to identify the template. This is what you use to match the link formed by this template to the content you'd like to switch between. The id should be unique and only contain letters. Numbers will break the formatting and can possibly cause conflicts with anything similarly named.|Required}}
{{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|id=example}}
{{switch|content=This is hidden text.}}
{{content|id=example|hide=This is hidden text.}}
</pre>
</pre>
This results in:
This results in:
{{switch|id=example}}
{{switch|content=This is hidden text.}}
{{content|id=example|hide=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.}}
{{content|id=exampleB|show=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.}}
{{content|id=exampleB|show=This text can be hidden.}}


{{Cat|Formatting Templates}}</noinclude>
{{Cat|Formatting Templates}}</noinclude>

Navigation menu