Template:Hide: Difference between revisions

Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
no edit summary
(added "default" argument)
No edit summary
Line 1: Line 1:
{{#ifeq: {{{default|}}} | show
{{#switch:{{{1|}}}
|{{#vardefine:init1|show}}{{#vardefine:init2|visible}}{{#vardefine:alt1|hide}}{{#vardefine:alt2|hidden}}
  | ~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>
|{{#vardefine:init1|hide}}{{#vardefine:init2|hidden}}{{#vardefine:alt1|show}}{{#vardefine:alt2|visible}}
  | ~content = <div class="_toggle_inithide _toggle toggle-hidden" style="{{{style|{{{3|}}}}}}">{{{content|{{{2|}}}}}}</div>
}}<!--
-->{{#switch:{{{1|}}}
  | ~button = <span class="_togglegroup _toggle_init{{#var:alt1}} _toggle _toggler toggle-{{#var:alt2}}" style="display:none; {{{style|{{{showstyle|}}}}}}">{{{show|[show]}}}</span><span class="_toggle_init{{#var:init1}} _toggle _toggler toggle-{{#var:init2}}" style="display:none; {{{style|{{{hidestyle|}}}}}}">{{{hide|[hide]}}}</span>
  | ~content = <div class="_toggle_init{{#var:init1}} _toggle toggle-{{#var:init2}}" 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>
  | ~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_init{{#var:alt1}} _toggle _toggler toggle-{{#var:alt2}}" style="display:none;">{{{show|[show]}}}</span><span class="_toggle_init{{#var:init1}} _toggle _toggler toggle-{{#var:init2}}" style="display:none;">{{{hide|[hide]}}}</span><div class="_toggle_init{{#var:init1}} _toggle toggle-{{#var:init2}}">{{{content|{{{1}}}}}}</div>
  | #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>
}}<noinclude>
==Purpose==
==Purpose==
This template allows easy hiding of text and other content.
This template allows easy hiding of text and other content.
Line 20: Line 17:
|show=
|show=
|hide=
|hide=
|default=
|content=
|content=
}}
}}
Line 26: Line 22:
{{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 being hidden.|Optional|[hide]}}
{{Parameter|hide|This specifies the text of the link that switches the content back to being hidden.|Optional|[hide]}}
{{Parameter|default|If set to ''show'', content will be displayed by default and the button will hide it.|Optional|hide}}
{{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}}
Line 80: Line 75:
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}}
To reverse the function of the button:
<div style="float:left; margin-right:20px"><pre>
{{Hide|default=show|This text was already displayed. You should hide it.}}
</pre></div>{{clear}}
This results in:
{{Hide|default=show|This text was already displayed. You should hide it.}}
{{clear}}
{{clear}}


Navigation menu