Template:Spoiler: Difference between revisions

From Step Mods | Change The Game
No edit summary
mNo edit summary
Line 2: Line 2:
--><div id="collapse-pre-one" class="mw-collapsible mw-collapsed spoiler"><!--
--><div id="collapse-pre-one" class="mw-collapsible mw-collapsed spoiler"><!--
       SPOILER TOGGLE
       SPOILER TOGGLE
     --><div class="mw-collapsible-toggle"><span class="up small">&#10133; [Click to show]</span><span class="down small">&#10134; [Click to hide]</span> <span class=orangetx>{{{shown}}}</span><!--
     --><div class="mw-collapsible-toggle"><span class="up small">&#10133; [Click to show]</span><span class="down small">&#10134; [Click to hide]</span> <span class=stepTitle>{{{shown}}}</span><!--
       SPOILER CONTENT
       SPOILER CONTENT
     --></div><div class="mw-collapsible-content spoiler-content p-2 pl-4">
     --></div><div class="mw-collapsible-content spoiler-content p-2 pl-4"><!-- THIS IMPLICIT BREAK IS INTENDED! -->
{{{hidden}}}</div><!--
{{{hidden}}}</div><!--
--></div><!--
--></div><!--
Line 10: Line 10:


==Purpose & Usage==
==Purpose & Usage==
This template allows text to be clicked like a spoiler to show hidden text immediately underneath it.
<templatedata>
 
{
===Parameters===
"params": {
*''parameter shown'' is the 'shown' title of the toggle when collapsed
"shown": {
*''parameter hidden'' is the hidden content under the toggle when expanded
"description": "The instruction title",
"example": "Descriptive title like: \"Steps to Perform Clean Install\"",
"type": "string",
"required": true
},
"hidden": {
"description": "Expanded content",
"example": "Assorted content (list, paragraph, etc.)",
"type": "content",
"required": true
}
},
"description": "This allows a title to be clicked like a spoiler to show expandedhidden content beneath the title. "
}
</templatedata>


==Examples==
==Examples==
Line 45: Line 59:


== See Also ==
== See Also ==
No similar templates known.
* [[:Template:CollapsibleTable]]


</noinclude>
</noinclude>

Revision as of 23:55, April 18, 2023


Purpose & Usage[edit source]

This allows a title to be clicked like a spoiler to show expandedhidden content beneath the title.

Template parameters

ParameterDescriptionTypeStatus
shownshown

The instruction title

Example
Descriptive title like: "Steps to Perform Clean Install"
Stringrequired
hiddenhidden

Expanded content

Example
Assorted content (list, paragraph, etc.)
Contentrequired

Examples[edit source]

Code:

{{Spoiler|shown=Instructions|hidden=Hidden content}}

Result:

➕ [Click to show]➖ [Click to hide] Instructions
Hidden content

Code:

{{Spoiler|shown=Procedure|hidden=# Beginning with a list now works.
#*You can nest different types of lists.
#*:It Just Works!}}

Result:

➕ [Click to show]➖ [Click to hide] Procedure
  1. Beginning with a list now works.
    • You can nest different types of lists.
      It Just Works!

Code:

{{Spoiler|shown=A Process|hidden= ===Include a heading===
Headings now work on the first line with no extra things in front of it.}}

Result:

➕ [Click to show]➖ [Click to hide] A Process

Include a heading

Headings now work on the first line with no extra things in front of it.

Known Issues[edit source]

  • Incompatible with CSS extension

See Also[edit source]