5,862 Pages

Template-info.svg Template Documentation (sometimes hidden or invisible)

Template tools: purgewhat links herewhat transclude thissubpages


This template has to be use in parallel with toggling functions. It will only create the element that will be hidden/shown by the function.


This template uses the following JavaScript codes: MediaWiki:Common.js/elementClass.js and [[MediaWiki:Common.js/togglers.js]]. The codes must be placed or imported in MediaWiki:Common.js.


{{Toggle|default=|sost=|var=}}. Or if given as free parameters: {{Toggle|Valore di default|Valore da sostituire|Nome variabile}}.
The switch element must have this class (you can use a tag like this): <span class="_toggler-toto">Change</span>.


1=/default= default text - optional.
2=/sost= alternative text - optional.
3=/var= element ID - avoid giving the same ID two different not-related switch elements.


Change a text with another through a link: {{Toggle|default=Default|sost=Alternative|var=switch1}} and

<span class="_toggler-switch1">Change!</span>


If the second parameter is null, then the text will be hidden:
{{Toggle|var=switch2}} and

<span class="_toggler-switch2">Hide</span>

This text will be hidden

To change the contents with different links:

{{Toggle|text 1 (as first parameter is the default text)||var1}}
{{Toggle||text 2 (as second parameter is hidden by default)|var2}}

<span class="_toggler_hide-var2 _toggler_show-var1">link var1</span>
<span class="_toggler_hide-var1 _toggler_show-var2">link var2</span>

text 1

link var1 | link var2


The "toggling classes" used by this template are: - "_toggle NAMEVAR": element NAMEVAR, the ID.
- "_toggler_hide-NAMEVAR": clicking on this element, NAMEVAR will be hidden.
- "_toggler_show-NAMEVAR": clicking on this element, NAMEVAR will be shown.
An element can have multiple classes.

See also

For help with this template you can contact leviathan_89.

Visit Template:Toggle/doc to edit this text! (How does this work?) (Refresh this text - why?)

Community content is available under CC-BY-SA unless otherwise noted.