Template:Hide: Difference between revisions

From Zelda Dungeon Wiki
Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
mNo edit summary
No edit summary
Line 1: Line 1:
{{#switch:{{{1|}}}
{{#switch:{{{1|}}}
|#default=<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>
|#default=<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>
|~button=<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>
|~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>
}}<noinclude>
}}<noinclude>
Line 26: Line 26:
For advanced usage, use this code:
For advanced usage, use this code:
<div style="float:left; margin-right:20px"><pre>
<div style="float:left; margin-right:20px"><pre>
{{hide|~button|show=[show]|hide=[hide]}}
{{hide|~button|show=[show]|hide=[hide]|style=}}
{{hide|~content|content=|style=}}
{{hide|~content|content=|style=}}
</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 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}}
{{clear}}

Revision as of 09:40, January 16, 2012

{{{1}}}

Purpose

This template allows easy hiding of text and other content.

Usage

To use this template, use either the standard format     {{Hide| content }} or the named parameter format:

{{Hide
|show=
|hide=
|content=
}}
  • show — This specifies the text of the link that shows the content that is initially hidden. (Optional - [show])
  • hide — This specifies the text of the link that switches the content back to being hidden. (Optional - [hide])
  • content — This specifies the content you want to be able to hide (Optional )

Advanced Usage

If this isn't enough, the template can be used in parts instead, for more flexible use within tables and div boxes.
For advanced usage, use this code:

{{hide|~button|show=[show]|hide=[hide]|style=}}
{{hide|~content|content=|style=}}

The button can be placed anywhere before {{hide|~begin}}. It will only affect the next instance of {{hide|~begin}}. 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.
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.

Example

To hide some text, use the following:

{{Hide|This is hidden text.}}

This results in:

This is hidden text.

Alternatively:

{{Hide|content=This is hidden text.}}

This results in:

This is hidden text.

To change what the buttons say:

{{Hide|show=[Unearth hidden secrets]|hide=[I'm done looking]|content=This is hidden text.}}

This results in:

This is hidden text.