Template:Spoiler/doc: Difference between revisions

From Unknown Variable
Jump to navigation Jump to search
No edit summary
 
Line 2: Line 2:


== The hoverShowSpoilers gadget ==
== The hoverShowSpoilers gadget ==
Users can enable <code>Gadget-hoverShowSpoilers</code> to make spoilers show on hover, not just on click. The code for this gadget can be found at {{gad|hoverShowSpoilers.css}}.
Users on the original wiki this template came from can enable <code>Gadget-hoverShowSpoilers</code> to make spoilers show on hover, not just on click. The code for this gadget can be found at {{gad|hoverShowSpoilers.css}}.


== Examples ==
== Examples ==

Latest revision as of 09:29, 21 October 2025

This template is used to mark text and other elements as spoilers. Users can click or optionally hover to reveal their content. See more at https://support.wiki.gg/wiki/Template:Spoiler

The hoverShowSpoilers gadget

Users on the original wiki this template came from can enable Gadget-hoverShowSpoilers to make spoilers show on hover, not just on click. The code for this gadget can be found at Gadget-hoverShowSpoilers.css.

Examples

Code Result
{{spoiler|spoiler text}} (Click to toggle) spoiler text
{{spoiler|spoiler text with a [[Template:Navbox|link]]}} (Click to toggle) spoiler text with a link
{{spoiler|block=y|Really long spoiler that spans multiple lines

It even has a bulleted list inside it:
* Item a
* Item b
* [[Special:Random|Item c]]
}}
Really long spoiler that spans multiple lines

It even has a bulleted list inside it:

Dependencies

For this template to work properly, you need the following:

Source

Base code adapted from Template:Spoiler on Terraria Wiki.

TemplateData

This template can be used to mark text as a spoiler.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Text1 text

The text to be shown.

Example
Character A died during the battle.
Contentrequired
Show on Hover?hover

Show spoiler text on mouse hover.

Default
hover=no
Example
hover=yes
Booleanoptional
Display as block?block

If given, display the spoiler as a block instead of inline. Useful for long spoilers spanning multiple lines or using block-level elements like lists.

Example
y
Booleansuggested
Classclass

A class or classes to apply to the spoiler

Stringoptional
IDid

A CSS ID to apply to the spoiler.

Stringoptional
Stylestyle css

Inline CSS styles to pass in.

Stringoptional