Template:Toggle

From Twisted Wonderland Wiki
Jump to navigation Jump to search

Source

openwetware, specifically copied from the Fairy Tail Wiki

Usage

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

  • Parameter 1 : Default content
  • Parameter 2 : Replacement content (optional)
  • Parameter 3 : Toggle class name

Ex : To replace a text with another by clicking on a link

{{Toggle|xxx text |yyyy text|toto}}
<span class="_toggler-toto">change text</span>

xxx text change text

When the second parameter is empty, it allows to make the text from parameter 1 disappear

{{Toggle|xxx text ||tata}}
<span class="_toggler-tata">hide text</span>

xxx text hide text

To change the content by using different link

{{Toggle|var1 xxx||var1}} <!-- var1 text will be displayed at start since it is the first parameter -->
{{Toggle||var2 zzz|var2}} <!-- var2 text will be hidden at start since it is the second parameter -->
<span class="_toggler_hide-var1 _toggler_show-var2">link to var2</span>
<span class="_toggler_hide-var2 _toggler_show-var1">link to var1</span>

var1 xxx link to var2 | link to var1

Template Data

Formats toggleable content

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Default content1

The default content that can then be toggled

Auto value
Linerequired
Alternate content2

The alternate content that can be toggled to. Leave empty to make the default content disappear without a replacement

Auto value
Linerequired
Toggle ID3

Specifies which toggler on the article this content should be associated with

Auto value
1
Linesuggested