Template:Collapse: Difference between revisions

From MENACE Official Wiki
Add a 'Collapse' template to hide spoilers by collapsing them (WIP)
 
mNo edit summary
Line 16: Line 16:
! colspan="2"| Parameter !! Description !! Example
! colspan="2"| Parameter !! Description !! Example
|-
|-
| <b>1</b> or <b>content</b> || required || Content of the spoiler || content=This is a spoiler!
| <code>1</code> or <code>content</code> || required || Content of the spoiler || <code>content=This is a spoiler!</code>
|-
|-
| <b>init</b> || optional || Initial state of the spoiler. Default is closed. || init=open
| <code>init</code> || optional || Initial state of the spoiler. Default is closed. || <code>init=open</code>
|-
|-
| <b>type</b> || optional || Include this, if the content of the spoiler spans multiple lines. Default is inline. || type=block
| <code>type</code> || optional || Include this, if the content of the spoiler spans multiple lines. Default is inline. || <code>type=block</code>
|-
|-
| <b>expandText</b> || optional || Text of the expand button/link. Default is "Show Spoiler" || expandText=Show
| <code>expandText</code> || optional || Text of the expand button/link. Default is "Show Spoiler" || <code>expandText=Show</code>
|-
|-
| <b>collapseText</b> || optional || Text of the collapse button/link. Default is "Hide Spoiler" || expandText=Hide
| <code>collapseText</code> || optional || Text of the collapse button/link. Default is "Hide Spoiler" || <code>expandText=Hide</code>
|}
|}



Revision as of 22:21, 31 January 2026

Overview

Use this template if you want to hide a spoiler by collapsing it.

You can hide the following:

  • inline text
  • multiple lines (see parameters)
  • single cells of tables
  • images
  • other templates

This template does not allow you to hide entire tables. Use the class="mw-collapsible" for tables instead. You can find more information about that here.

Parameters

Parameter Description Example
1 or content required Content of the spoiler content=This is a spoiler!
init optional Initial state of the spoiler. Default is closed. init=open
type optional Include this, if the content of the spoiler spans multiple lines. Default is inline. type=block
expandText optional Text of the expand button/link. Default is "Show Spoiler" expandText=Show
collapseText optional Text of the collapse button/link. Default is "Hide Spoiler" expandText=Hide

Examples

To hide text inline, use:

Example text that is before the spoiler: {{Collapse|This is a spoiler!}} And an example text after the spoiler.

to get this:

Example text that is before the spoiler: This is a spoiler! And an example text after the spoiler.


To hide text over multiple lines, use the paramter type=block:

{{Collapse|type=block|

This spoiler spans multiple paragraphs.

It is really long!!!
}}

To get this:

This spoiler spans multiple paragraphs.

It is really long!!!



Change the text of the expand and collapse buttons/links like this:

{{Collapse
|SPOILER!
|expandText=Show
|collapseText=Hide
}}

To get this:

SPOILER!



You can collapse individual table cells by wrapping their contents in this template:

Name Range HP Damage Supply Cost
BR3A3 Kr-BaR "Crowbar"
9 11 9
BR3A3 Kr-BaRMOD1
10 12 13