Template:Hide: Difference between revisions

Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
(Improved examples.)
No edit summary
Line 3: Line 3:
|~button=<span class="_togglegroup _toggle_initshow _toggle _toggler toggle-visible" style="display:none; {{{style|{{{showstyle|}}}}}}">{{{show|[show]}}}</span><span class="_toggle_inithide _toggle _toggler toggle-hidden" style="display:none; {{{style|{{{hidestyle|}}}}}}">{{{hide|[hide]}}}</span>
|~button=<span class="_togglegroup _toggle_initshow _toggle _toggler toggle-visible" style="display:none; {{{style|{{{showstyle|}}}}}}">{{{show|[show]}}}</span><span class="_toggle_inithide _toggle _toggler toggle-hidden" style="display:none; {{{style|{{{hidestyle|}}}}}}">{{{hide|[hide]}}}</span>
|~content=<div class="_toggle_inithide _toggle toggle-hidden" style="{{{style|{{{3|}}}}}}">{{{content|{{{2|}}}}}}</div>
|~content=<div class="_toggle_inithide _toggle toggle-hidden" style="{{{style|{{{3|}}}}}}">{{{content|{{{2|}}}}}}</div>
|~showall=<span class="_toggler_show-toggle-hidden _toggler_hide-toggle-visible" style="{{{style|{{{3|}}}}}}">{{{text|{{{2|[show all]}}}}}}</span>
|~hideall=<span class="_toggler_hide-toggle-hidden _toggler_show-toggle-visible" style="{{{style|{{{3|}}}}}}">{{{text|{{{2|[hide all]}}}}}}</span>
}}<noinclude>
}}<noinclude>
==Purpose==
==Purpose==
Line 30: Line 32:
</pre></div>
</pre></div>
The button can be placed anywhere before <nowiki>{{hide|~begin}}</nowiki>. It will only affect the next instance of <nowiki>{{hide|~begin}}</nowiki>. Future instances require another button. The ''style'' parameter for the button is to add styling for the button's span tags. This parameter styles both the show and hide version of the button. To style each version of the button seperately, omit the ''style'' parameter and instead use the ''showstyle'' and ''hidestyle'' parameters to style the show and hide version of the button, respectively.<br>The ''style'' parameter on the content is to enter any styling directly in to the div for the content, in addition to any other styling you use outside of it. You can delete the ''show'' and ''hide'' parameters if you do not wish to change them from their defaults.
The button can be placed anywhere before <nowiki>{{hide|~begin}}</nowiki>. It will only affect the next instance of <nowiki>{{hide|~begin}}</nowiki>. Future instances require another button. The ''style'' parameter for the button is to add styling for the button's span tags. This parameter styles both the show and hide version of the button. To style each version of the button seperately, omit the ''style'' parameter and instead use the ''showstyle'' and ''hidestyle'' parameters to style the show and hide version of the button, respectively.<br>The ''style'' parameter on the content is to enter any styling directly in to the div for the content, in addition to any other styling you use outside of it. You can delete the ''show'' and ''hide'' parameters if you do not wish to change them from their defaults.
{{clear}}
====Special Buttons====
There are two special buttons available that can affect all instances of the hide template on a page. One is ''show all'', that will show all instances of the hide template on a page, and the other is ''hide all'', which does the opposite.
Both have two ways to be used.
*show all
{{Desc|Normal|~showall|text|style}}
::<div style="float:left; margin-right:20px"><pre>{{Hide|~showall|text=|style=}}</pre></div>
{{Parameter|text|Text text displayed for the button|Optional|[show all]}}
{{Parameter|style|Any styling options to apply to the button if desired.|Optional}}
{{clear}}
*hide all
{{Desc|Normal|~hideall|text|style}}
::<div style="float:left; margin-right:20px"><pre>{{Hide|~hideall|text=|style=}}</pre></div>
{{Parameter|text|This specifies the text of the link that shows the content that is initially hidden.|Optional|[hide all]}}
{{Parameter|style|Any styling options to apply to the button if desired.|Optional}}


{{clear}}
{{clear}}
Line 71: Line 90:
<font size=3 color="black"><b>{{hide|~button|style=float:left;}}</b></font>:{{hide|~content|style=float:right;|content=This is hidden text.}}
<font size=3 color="black"><b>{{hide|~button|style=float:left;}}</b></font>:{{hide|~content|style=float:right;|content=This is hidden text.}}
|}
|}
 
{{clear}}
Basic show all and hide all buttons:
<div style="float:left; margin-right:20px"><pre>
{{hide|~showall}} {{hide|~hideall}}
</pre></div>{{clear}}
This results in:
:{{hide|~showall}} {{hide|~hideall}}
{{clear}}
{{clear}}
{{Cat|Formatting Templates}}</noinclude>
{{Cat|Formatting Templates}}</noinclude>