imported>Dawning
doc creation (by SublimeText.Mediawiker)
the mass documenting
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
This template is used to create a button of the header type on this wiki.
'''<code>ButtonHeader</code> creates a big clickable section header (with an optional icon) that expands and collapses a block of content beneath it.'''
__TOC__


== Overview ==
This template renders a collapsible section: a styled header bar you click to show or hide everything inside it. The header can show a small icon to the left of its label, and the hidden body can contain any wikitext — tables, {{tl|ItemInfobox}} grids, more templates, etc. It is used heavily on collection-style pages such as [[Pets]], [[Mounts]] and class pages (e.g. [[Arcanist]]) to group items by rarity/category behind expandable buttons.
== Parameters ==
{| class="wikitable"
! Parameter !! Required? !! What it does !! Example
|-
| <code>type</code> || Required || Unique id that links the header to its collapsible body. Must be different for every ButtonHeader on the same page or two headers will toggle together. || <code>arcanistweapons</code>
|-
| <code>text</code> || Required || The label shown in the header bar. || <code>Weapons</code>
|-
| <code>img</code> || Optional || File name of the header icon, '''without''' the <code>.png</code> extension (the template adds it). Rendered at 64px. Omit for a text-only header. || <code>Ut-Magnificat</code>
|-
| <code>content</code> || Required || The wikitext that is shown/hidden when the header is clicked. Can be anything: text, tables, tabbers, other templates. || <code>{{ItemInfobox|...}}</code>
|}
== How to use ==
1. Pick a unique <code>type</code> id for this header (lowercase, no spaces is safest, e.g. <code>petsusual</code>). Reuse the same word nowhere else on the page.
2. Set <code>text</code> to the words you want on the button.
3. Optionally set <code>img</code> to an icon file name with NO extension — <code>img=Ut-Magnificat</code> displays <code>File:Ut-Magnificat.png</code>. The image link is disabled, so it is decorative only.
4. Put everything that should hide/show under <code>content=</code>. Because <code>content</code> usually spans many lines, put <code>|content=</code> on its own line and write the body underneath it, then close the template with <code>}}</code> on its own line.
5. The body starts '''collapsed''' (hidden) by default.
== Copy this ==
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{ButtonHeader
{{ButtonHeader
|type=ButtonHeaderExample
|type=
|text=Im Buttoning It
|text=
|img=Sitelogo
|img=
|content=Hello this is what appears when you open me, you can put anything here, like this infobox!
|content=
{{NPCInfobox
|title=blahblahblah
}}
}}
}}
</syntaxhighlight>


==Example Shown==
== Example ==
<syntaxhighlight lang="wikitext" style="overflow: auto;">
{{ButtonHeader
{{ButtonHeader
|type=ButtonHeaderExample
|type=exampleusual
|text=Im Buttoning It
|text=Usual
|img=Sitelogo
|img=2DSlimeArcher
|content=Hello this is what appears when you open me, you can put anything here, like this infobox!
|content=
{{NPCInfobox
Completion Reward: [[Transcendence|Rare Soul Point Potion]]
|title=blahblahblah
{{ItemInfobox
| title = Slime Archer
| images = 3DSlimeArcher.png
| Type = Ranged
| Damage = 12 (4 dps)
| Drop = [[Skull Cavern]];Key-SkullCavern
}}
}}
}}
}}
</syntaxhighlight>


==Copy This==
<syntaxhighlight lang="wikitext" style="overflow:auto;">
<syntaxhighlight lang="wikitext" style="overflow: auto;">
{{ButtonHeader
{{ButtonHeader
|type=
|type=exampleusual
|text=
|text=Usual
|img=
|img=2DSlimeArcher
|content=
|content=
Completion Reward: [[Transcendence|Rare Soul Point Potion]]
{{ItemInfobox
| title = Slime Archer
| images = 3DSlimeArcher.png
| Type = Ranged
| Damage = 12 (4 dps)
| Drop = [[Skull Cavern]];Key-SkullCavern
}}
}}
}}
</syntaxhighlight>
</syntaxhighlight>
== Tips & notes ==
* The single most common mistake is reusing the same <code>type</code> value twice on a page — both headers then expand/collapse as one. Always make <code>type</code> unique.
* <code>img</code> takes the bare file name only. Do '''not''' write <code>img=Ut-Magnificat.png</code> and do not write <code>[[File:...]]</code> — the template adds <code>.png</code> for you.
* The body is collapsed on load. There is no parameter to make it start expanded.
* <code>content</code> commonly wraps a <code>&lt;div style="display:flex;flex-wrap:wrap;..."&gt;</code> and a list of {{tl|ItemInfobox}} calls (see [[Pets]]). It can also hold a <code>&lt;tabber&gt;</code> for sub-sections (see [[Arcanist]]).
* Related: {{tl|ItemInfobox}} (the cards usually placed inside), and the <code>hoverbox</code> div that often wraps a ButtonHeader.

Latest revision as of 11:55, 20 June 2026

ButtonHeader creates a big clickable section header (with an optional icon) that expands and collapses a block of content beneath it.

Overview

This template renders a collapsible section: a styled header bar you click to show or hide everything inside it. The header can show a small icon to the left of its label, and the hidden body can contain any wikitext — tables, {{ItemInfobox}} grids, more templates, etc. It is used heavily on collection-style pages such as Pets, Mounts and class pages (e.g. Arcanist) to group items by rarity/category behind expandable buttons.

Parameters

Parameter Required? What it does Example
type Required Unique id that links the header to its collapsible body. Must be different for every ButtonHeader on the same page or two headers will toggle together. arcanistweapons
text Required The label shown in the header bar. Weapons
img Optional File name of the header icon, without the .png extension (the template adds it). Rendered at 64px. Omit for a text-only header. Ut-Magnificat
content Required The wikitext that is shown/hidden when the header is clicked. Can be anything: text, tables, tabbers, other templates.

How to use

1. Pick a unique type id for this header (lowercase, no spaces is safest, e.g. petsusual). Reuse the same word nowhere else on the page. 2. Set text to the words you want on the button. 3. Optionally set img to an icon file name with NO extension — img=Ut-Magnificat displays File:Ut-Magnificat.png. The image link is disabled, so it is decorative only. 4. Put everything that should hide/show under content=. Because content usually spans many lines, put |content= on its own line and write the body underneath it, then close the template with }} on its own line. 5. The body starts collapsed (hidden) by default.

Copy this

{{ButtonHeader
|type=
|text=
|img=
|content=
}}

Example

 File:2DSlimeArcher.png Usual

Completion Reward: Rare Soul Point Potion

Slime Archer
Stats
Type
Ranged
Damage
12 (4 dps)
Obtained From


{{ButtonHeader
|type=exampleusual
|text=Usual
|img=2DSlimeArcher
|content=
Completion Reward: [[Transcendence|Rare Soul Point Potion]]
{{ItemInfobox
| title = Slime Archer
| images = 3DSlimeArcher.png
| Type = Ranged
| Damage = 12 (4 dps)
| Drop = [[Skull Cavern]];Key-SkullCavern
}}
}}

Tips & notes

  • The single most common mistake is reusing the same type value twice on a page — both headers then expand/collapse as one. Always make type unique.
  • img takes the bare file name only. Do not write img=Ut-Magnificat.png and do not write File:... — the template adds .png for you.
  • The body is collapsed on load. There is no parameter to make it start expanded.
  • content commonly wraps a <div style="display:flex;flex-wrap:wrap;..."> and a list of {{ItemInfobox}} calls (see Pets). It can also hold a <tabber> for sub-sections (see Arcanist).
  • Related: {{ItemInfobox}} (the cards usually placed inside), and the hoverbox div that often wraps a ButtonHeader.