Template:Spoiler: Difference between revisions
CoreyPlover (talk | contribs) mNo edit summary Tag: Reverted |
(use no-break space for inline spoilers) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly><div class="mw-collapsible mw-collapsed spoiler-collapsible-{{#if: {{{class|}}}|{{{class}}}|default}}" data-expandtext="{{#if: {{{label|}}}|{{{label}}}|► Click to reveal}}" data-collapsetext="{{#if: {{{label-hide|}}}|{{{label-hide}}}|▼ Click to hide}}"> |
<includeonly>{{#if: {{{text|}}}|<span class="spoiler-inline spoiler-inline-{{#if: {{{class|}}}|{{{class}}}|default}} spoiled"><span class="spoiler-inline-label">{{#if: {{{label|}}}|{{{label}}}|Click to reveal}}</span><span class="spoiler-inline-content" data-nosnippet>{{{text}}}</span></span>|<div class="mw-collapsible mw-collapsed spoiler-collapsible-{{#if: {{{class|}}}|{{{class}}}|default}}" data-expandtext="{{#if: {{{label|}}}|► {{{label}}}|► Click to reveal}}" data-collapsetext="{{#if: {{{label-hide|}}}|{{{label-hide}}}|▼ Click to hide}}"> |
||
<div class="mw-collapsible-header"> </div> |
<div class="mw-collapsible-header"> </div> |
||
<div class="mw-collapsible-content"> |
<div class="mw-collapsible-content" data-nosnippet>}}</includeonly><noinclude>{{documentation}}</noinclude> |
||
</includeonly> |
Latest revision as of 00:32, 31 October 2022
Puts text into a clickable-to-reveal spoiler.
Usage[edit source]
{{spoiler | text = [Optional] Inline text. If omitted, a block spoiler will be created (and should be ended with {{spoiler-end}}.) | label = [Optional] Spoiler label. Default is "Click to reveal" | label-hide = [Optional] Spoiler hide label (for block level spoilers only). Default is "Click to hide" | class = [Optional] CSS class to use for styles. Default is "default" }}
Examples[edit source]
This is an Click to revealinline spoiler.
Puts small amounts of text into a clickable-to-reveal spoiler. Takes two parameters, text
(what will be revealed on click) and spoilertext
(a label; the latter is optional. You can also simply use them as the first and second parameter (unless the text has a =
, for technical reasons), as shown:
{{spoiler}}
THIS IS A BLOCK CONTENT SPOILER.
THIS IS MORE CONTENT
{{spoiler-end}}
gives
THIS IS A BLOCK CONTENT SPOILER.
THIS IS MORE CONTENT
{{spoiler|label=This is a multi-nested spoiler}}
THIS IS A BLOCK CONTENT SPOILER.
THIS IS MORE CONTENT
{{spoiler}}
THIS IS A NESTED BLOCK LEVEL SPOILER
{{spoiler-end}}
THIS IS A {{spoiler|text=NESTED INLINE SPOILER}}.
{{spoiler-end}}
THIS IS A BLOCK CONTENT SPOILER.
THIS IS MORE CONTENT
THIS IS A NESTED BLOCK LEVEL SPOILER
THIS IS A Click to revealNESTED INLINE SPOILER.