Template:CustomCollapse

From MinecraftOnline
Jump to navigation Jump to search

For creating collapsibles with custom collapse text positioned with left-alignment on the active line and defaulting to collapsed.

Note: collapsible contents whose formatting involves properties of wikicode line(s) - e.g. preformatted text (accessed by starting a line with a space) - should be wrapped in a div (see the example).

n should start at 0 (or 1) and be manually incremented by +1 with each new template use within one page

Template Format

{{CustomCollapse
|n          = (required:integer) - id number; starting at 0 (or 1) and manually incremented
|collapsed  = (required) - contents of collapsed section
|toggletext = (optional) - blue-colored text for toggling display/hide; defaults to "[Toggle display]"
}}

Empty Template

Retain all fields even if optional unused.

{{CustomCollapse
|n          =
|collapsed  =
|toggletext =
}}

Example

Collapsing preformatted text. {{CustomCollapse
|n          = 0
|collapsed  = 
<div>
 Test
</div>
|toggletext = Show/Hide
}}

Produces:


Collapsing preformatted text. Show/Hide

Test