Template:Collapsible section: Difference between revisions

From Wizards and Warlords
Jump to navigation Jump to search
Created page with "<includeonly><div class="wizlords-toc-only-heading"> === {{{toc}}} === </div> <div{{#if:{{{id|}}}| id="{{{id}}}"}} class="wizlords-collapsible-section mw-collapsible mw-collapsed wizlords-collapsed-hint-section"> <div class="wizlords-collapsible-section-title">{{{title}}}</div> <div class="wizlords-collapsed-hint">{{{summary}}}</div> <div class="mw-collapsible-content"> {{{content}}} {{#if:{{{bottom|}}}|<div class="wizlords-collapsible-section-bottom-toggle{{#if:{{{botto..."
 
No edit summary
 
Line 2: Line 2:
=== {{{toc}}} ===
=== {{{toc}}} ===
</div>
</div>
<div{{#if:{{{id|}}}| id="{{{id}}}"}} class="wizlords-collapsible-section mw-collapsible mw-collapsed wizlords-collapsed-hint-section">
<div {{#if:{{{id|}}}|id="{{{id}}}"|}} class="wizlords-collapsible-section mw-collapsible mw-collapsed wizlords-collapsed-hint-section">
<div class="wizlords-collapsible-section-title">{{{title}}}</div>
<div class="wizlords-collapsible-section-title">{{{title}}}</div>
<div class="wizlords-collapsed-hint">{{{summary}}}</div>
<div class="wizlords-collapsed-hint">{{{summary}}}</div>
<div class="mw-collapsible-content">
<div class="mw-collapsible-content">
{{{content}}}
{{{content}}}
{{#if:{{{bottom|}}}|<div class="wizlords-collapsible-section-bottom-toggle{{#if:{{{bottom class|}}}| {{{bottom class}}}}}">[<span>Collapse</span>]</div>}}
{{#if:{{{bottom|}}}|<div class="wizlords-collapsible-section-bottom-toggle {{{bottom class|}}}">[<span>Collapse</span>]</div>}}
</div>
</div>
</div></includeonly><noinclude>
</div></includeonly><noinclude>
Line 38: Line 38:
</pre>
</pre>


Keep <code>toc</code> separate from <code>title</code> when the TOC entry contains a manual section number.
amaKeep <code>toc</code> separate from <code>title</code> when the TOC entry contains a manual section number.
</noinclude>
</noinclude>

Latest revision as of 04:12, 16 July 2026

About this template

[edit]

Creates a reusable collapsed article section together with its hidden table-of-contents heading. The existing MediaWiki collapsible system controls the top toggle, and an optional bottom control can close longer sections.

Do not change the generated CSS classes or move the content wrapper. The site CSS, Citizen presentation, and shared JavaScript depend on this structure.

Parameters

[edit]
  • toc - exact text for the hidden level-three TOC heading, including any manual number.
  • title - visible title on the collapsible box.
  • summary - short hint shown while the section is collapsed.
  • content - the section's wikitext content.
  • id - optional exact ID for the outer box.
  • bottom - optional; set to yes to add the existing bottom Collapse control.
  • bottom class - optional additional class required by a specific bottom control.

Basic example

[edit]
{{Collapsible section
|toc=5.1. Approved Weapon Brands
|title=Approved Weapon Brands
|summary=Expand this section to view commonly approved weapon brands.
|content=
The following brands are generally accepted, pending safety inspection:

* Example Brand
* Another Brand
}}

amaKeep toc separate from title when the TOC entry contains a manual section number.