Template:Collapsible

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search

Purpose

Makes content collapsible. Used for large lists and tables as well as other supplementary content such as companion comments. It has also been used to describe plots with forking paths (see The Crystal Trap and The Subspace Emissary).

Usage

Required ParametersAll Parameters
{{Collapsible
|content= 
}}
{{Collapsible
|id= 
|header= 
|frame= 
|collapse= 
|stretch= 
|buttonHide= 
|buttonShow= 
|content= 
}}
ParameterStatusDescriptionDefault value
idoptionalSets the ID attribute of the collapsible content so that it can be linked as a section. Defaults to header.
headersuggestedThe title of the collapsible content.
frameoptionalIf present, a border is added around the collapsible content and header.
collapseoptional

If present, the content starts off in the collapsed state on page load.

Content is collapsed by default when frame is set. To override this, set collapse to false.

stretchoptionalIf present, the header stretches to fill the screen rather than fitting itself to its content. Works only when frame is enabled.
buttonHideoptionalText to use for the "hide" button labelhide
buttonShowoptionalText to use for the "show" button labelshow
contentrequiredThe content to be made collapsible.

Makes content collapsible.

Template parameters

ParameterDescriptionTypeStatus
idid

Sets the [https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id ID attribute] of the collapsible content so that it can be linked as a [[Template:Section|section]]. Defaults to <code>header</code>.

Stringoptional
headerheader

The title of the collapsible content.

Contentsuggested
frameframe

If present, a border is added around the collapsible content and header.

Booleanoptional
collapsecollapse

<p>If present, the content starts off in the collapsed state on page load.</p><p>Content is collapsed by default when <code>frame</code> is set. To override this, set <code>collapse</code> to <code>false</code>.</p>

Booleanoptional
stretchstretch

If present, the header stretches to fill the screen rather than fitting itself to its content. Works only when <code>frame</code> is enabled.

Booleanoptional
buttonHidebuttonHide

Text to use for the "hide" button label

Stringoptional
buttonShowbuttonShow

Text to use for the "show" button label

Stringoptional
contentcontent

The content to be made collapsible.

Contentrequired

Examples

Input
{{Collapsible
|header= List of Challenges
|content=
#Win your first battle!
#Win 5 times!
#Win 10 times!
#Win 20 times!
}}
Output
List of Challengeshide ▲
  1. Win your first battle!
  2. Win 5 times!
  3. Win 10 times!
  4. Win 20 times!

Input
{{Collapsible
|header= List of Challenges
|collapse= true
|content=
#Win your first battle!
#Win 5 times!
#Win 10 times!
#Win 20 times!
}}
Output
List of Challenges
  1. Win your first battle!
  2. Win 5 times!
  3. Win 10 times!
  4. Win 20 times!

Input
{{Collapsible
|header= List of Challenges
|frame= true
|content=
#Win your first battle!
#Win 5 times!
#Win 10 times!
#Win 20 times!
}}
Output
List of Challenges
  1. Win your first battle!
  2. Win 5 times!
  3. Win 10 times!
  4. Win 20 times!

Input
{{Collapsible
|header= List of Challenges
|frame= true
|collapse= false
|stretch= true
|content=
#Win your first battle!
#Win 5 times!
#Win 10 times!
#Win 20 times!
}}
Output
List of Challengeshide ▲
  1. Win your first battle!
  2. Win 5 times!
  3. Win 10 times!
  4. Win 20 times!

Letter#The Wind Waker transcripts, using the buttonHide and buttonShow parameters
Input
{{Collapsible
|collapse= true
|buttonHide= hide transcript
|buttonShow= show transcript
|content= {{Transcript Copy|fromPage= Aryll|storedAs= Letter}}
}}
Output

How have you been, Big Brother?
 I'm here on the pirate ship writing you
 this letter. Isn't that neat?

 At first, I was really scared, but they're
 all actually nice...for pirates, I mean.


 Mr. Gonzo is a really big guy, but ever
 since Miss Tetra left, he's been crying
 like a baby. It's kinda funny...but sort
 of sad, too.
 Nudge is a little strange, but nice, too,
 and as for Senza...his beard makes him
 look pretty mean, but he tells really cool
 stories when he gets in the right mood.
 Zuko's kind of weird, and Mako is pretty
 quiet... Mako immediately gets mad
 whenever I try to take his glasses...so I
 do that a lot. Hee hee!
 As usual, Niko is always fooling around.
 He won't take anything serious. Actually,
 he seems sad not to have you around
 anymore. Were you guys good friends?
 I helped them all out with their chores,
 and they actually paid me a little for it,
 so I'm sending the money to you. Please
 use it, Big Brother!
 I'll loan you my telescope for a little
 longer...but you have to return it to me
 eventually, OK?

 I'm doing fine here, so don't you worry.
 I'll take care of myself, so you be sure to
 take good care of yourself. Good luck!
                                      Aryll


content cannot be blank
Input
{{Collapsible
|header= foo
|content= 
}}
Output

When collapsing tables, pipe characters must be escaped using {{!}}, {{(!}}, and {{!)}}
Input
{{Collapsible
|header= Table
|frame= true
|collapse= false
|content=
{{(!}} class="wikitable"
! Table Header
{{!}} Table Content
{{!)}}
}}
Output
Tablehide ▲
Table Header Table Content

Guidelines

  • All collapsibles should have headers, with the exception of collapsibles used in table cells (e.g. Letter#The Wind Waker).
The above documentation is transcluded from Template:Collapsible/Documentation. (edit | history)