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.
No edit summary
m (Text replacement - "<br>" to "<br/>")
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<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>
{{#switch:{{{1|}}}
| ~button = <span class="_togglegroup _toggle_initshow _toggle _toggler toggle-visible" style="{{{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>
| ~all = <span class="_toggler_show-toggle-hidden _toggler_hide-toggle-visible _toggler-hideall _toggler-showall showall" style="{{{showstyle|}}}">{{{showtext|[show all]}}}</span><span class="_toggler_hide-toggle-hidden _toggler_show-toggle-visible _toggler-showall _toggler-hideall hideall" style="display:none; {{{hidestyle|}}}">{{{hidetext|[hide all]}}}</span>
| #default = <span class="_togglegroup _toggle_initshow _toggle _toggler toggle-visible">{{{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 allows easy hiding of text and other content.
This template allows easy hiding of text and other content.
Line 18: Line 24:
{{Parameter|content|This specifies the content you want to be able to hide|Optional}}
{{Parameter|content|This specifies the content you want to be able to hide|Optional}}
{{clear}}
{{clear}}
===Advanced Usage===
If this isn't enough, the template can be used in parts instead, for more flexible use within tables and div boxes. Advanced wiki-coding knowledge is suggested for using the hide template in this way.<br/>
For advanced usage, use this code:
<div style="float:left; margin-right:20px"><pre>
{{hide|~button|show=[show]|hide=[hide]|style=}}
{{hide|~content|content=|style=}}
</pre></div>
The button can be placed anywhere before <nowiki>{{hide|~content}}</nowiki>. It will only affect the next instance of <nowiki>{{hide|~content}}</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.
Note that you can also use images in place of text for the buttons. However, in order for them to function properly, the images must be set to link to nothing, instead of some other page or its own page.
{{clear}}
====Show All and Hide All====
There is a special button available that can affect all instances of the hide template on a page. It will open all instances of the hide template on the page, clicking it again will hide all of them.
To use the button, you can just use:
{{Desc|Normal|~all}}
{{clear}}
For more advanced handling, the following is available
<div style="float:left; margin-right:20px"><pre>
{{Hide|~all|showtext=|showstyle=|hidetext=|hidestyle=}}</pre></div>
{{Parameter|showtext|Text text displayed for the show all version of the button.|Optional|[show all]}}
{{Parameter|showstyle|Any styling options to apply to the show all version of the button if desired.|Optional}}
{{Parameter|hidetext|The text to show for the button to hide all the content again.|Optional|[hide all]}}
{{Parameter|hidestyle|Any styling options to apply to the hide all version of the button if desired.|Optional}}
{{clear}}
==Example==
==Example==
To hide some text, use the following:
To hide some text, use the following:
<pre>
<div style="float:left; margin-right:20px"><pre>
{{Hide|This is hidden text.}}
{{Hide|This is hidden text.}}
</pre>
</pre></div>{{clear}}
This results in:
This results in:
{{Hide|This is hidden text.}}
{{Hide|This is hidden text.}}
{{clear}}


Alternatively:
Alternatively:
<pre>
<div style="float:left; margin-right:20px"><pre>
{{Hide|content=This is hidden text.}}
{{Hide|content=This is hidden text.}}
</pre>
</pre></div>{{clear}}
This results in:
This results in:
{{Hide|content=This is hidden text.}}
{{Hide|content=This is hidden text.}}
{{clear}}


To change what the buttons say:
To change what the buttons say:
<pre>
<div style="float:left; margin-right:20px"><pre>
{{Hide|show=[Unearth hidden secrets]|hide=[I'm done looking]|content=This is hidden text.}}
{{Hide|show=[Unearth hidden secrets]|hide=[I'm done looking]|content=This is hidden text.}}
</pre>
</pre></div>{{clear}}
This results in:
This results in:
{{Hide|show=[Unearth hidden secrets]|hide=[I'm done looking]|content=This is hidden text.}}
{{Hide|show=[Unearth hidden secrets]|hide=[I'm done looking]|content=This is hidden text.}}
{{clear}}


An advanced example placing the template within a formatted table:
<div style="float:left; margin-right:20px;"><pre>
{| cellspacing="3" align="left" style="border: 2px solid blue; background-color: #transparent;"
|- valign="top"
| style="border: 2px solid blue; background-color: #white;padding-left: 6px;"|
<font size=3 color="black"><b>{{hide|~button|style=float:left;}}</b></font>:{{hide|~content|style=float:right;|content=This is hidden text.}}
|}
</pre></div>{{clear}}
This results in:
{| cellspacing="3" align="left" style="border: 2px solid blue; background-color: #transparent;"
|- valign="top"
| style="border: 2px solid blue; background-color: #white;padding-left: 6px;"|
<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|~all}}
</pre></div>{{clear}}
This results in:
:{{hide|~all}}
{{clear}}
{{Cat|Formatting Templates}}</noinclude>
{{Cat|Formatting Templates}}</noinclude>

Latest revision as of 17:47, February 8, 2015

[show]

{{{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. Advanced wiki-coding knowledge is suggested for using the hide template in this way.
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|~content}}. It will only affect the next instance of {{hide|~content}}. 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.

Note that you can also use images in place of text for the buttons. However, in order for them to function properly, the images must be set to link to nothing, instead of some other page or its own page.

Show All and Hide All

There is a special button available that can affect all instances of the hide template on a page. It will open all instances of the hide template on the page, clicking it again will hide all of them.

To use the button, you can just use:     {{Hide| ~all }}

For more advanced handling, the following is available

{{Hide|~all|showtext=|showstyle=|hidetext=|hidestyle=}}
  • showtext — Text text displayed for the show all version of the button. (Optional - [show all])
  • showstyle — Any styling options to apply to the show all version of the button if desired. (Optional )
  • hidetext — The text to show for the button to hide all the content again. (Optional - [hide all])
  • hidestyle — Any styling options to apply to the hide all version of the button if desired. (Optional )

Example

To hide some text, use the following:

{{Hide|This is hidden text.}}

This results in:

[show]

This is hidden text.

Alternatively:

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

This results in:

[show]

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:

[Unearth hidden secrets]

This is hidden text.

An advanced example placing the template within a formatted table:

{| cellspacing="3" align="left" style="border: 2px solid blue; background-color: #transparent;"
|- valign="top"
| style="border: 2px solid blue; background-color: #white;padding-left: 6px;"|
<font size=3 color="black"><b>{{hide|~button|style=float:left;}}</b></font>:{{hide|~content|style=float:right;|content=This is hidden text.}}
|}

This results in:

[show]:
This is hidden text.

Basic show all and hide all buttons:

{{hide|~all}}

This results in:

[show all]