Template:Spoiler: Difference between revisions
CoreyPlover (talk | contribs) mNo edit summary |
CoreyPlover (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
<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">{{{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}}"> |
<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">{{{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">}}</includeonly> |
<div class="mw-collapsible-content">}}</includeonly><noinclude>{{documentation}}</noinclude> |
Revision as of 15:43, 27 April 2022
Puts text into a clickable-to-reveal spoiler.
Usage
{{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
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.