Template:Hide

From Zelda Dungeon Wiki
Revision as of 10:05, January 16, 2012 by Emma (talk | contribs)
Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.

{{{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|~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.

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

    {{Hide| ~showall | text | style }}

{{Hide|~showall|text=|style=}}
  • text — Text text displayed for the button (Optional - [show all])
  • style — Any styling options to apply to the button if desired. (Optional )
  • hide all

    {{Hide| ~hideall | text | style }}

{{Hide|~hideall|text=|style=}}
  • text — This specifies the text of the link that shows the content that is initially hidden. (Optional - [hide all])
  • style — Any styling options to apply to the button if desired. (Optional )

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.

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:

:
This is hidden text.

Basic show all and hide all buttons:

{{hide|~showall}} {{hide|~hideall}}

This results in:

[show all] [hide all]