Template:Toggle
Template documentation
|
---|
Note: portions of the template sample may not be visible without values provided. |
View or edit this documentation. (About template documentation) |
Editors can experiment in this template's sandbox and test case pages. |
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
Parameter | Description | Type | Status | |
---|---|---|---|---|
Default content | 1 | The default content that can then be toggled
| Line | required |
Alternate content | 2 | The alternate content that can be toggled to. Leave empty to make the default content disappear without a replacement
| Line | required |
Toggle ID | 3 | Specifies which toggler on the article this content should be associated with
| Line | suggested |