Help:Collapsible Elements

From Savagepedia

It may be helpful in writing articles to have a block of text that is not visible until the user toggles a link to reveal the text. For instance, descriptions of campaigns that contain spoilers about surprise ambushes or endings could be written in the wiki without revealing them right away. To go further, a full campaign could be written in sectioned chapters, each chapter automatically collapsed so that the reader can expand them as they go.

Obviously this isn't fool proof and ultimately the wiki's goal is to share as much information as possible with all users, so there is no stopping a user from expanding all sections if they want to.

How to Set Up Collapsible Elements on a Page

The below information is taken from the MediaWiki Manual on Collapsible Elements but adapted for this specific wiki; please check out the source article if there are questions about use and for the most up to date revisions.

Adding a Collapsible Element

Section With Title

<div class="mw-collapsible mw-collapsed" style="width:100%; overflow:auto;border: 1px solid #c8ccd1;background-color:#f8f9fa;">
<div style="font-weight:bold;line-height:1.6;">GM Notes</div>
<div class="mw-collapsible-content">
The iron lockbox is actually a mimic. {{Lorem}}
</div></div>
GM Notes

The iron lockbox is actually a mimic. Template:Lorem

This will add a titled collapsible text box that starts collapsed. An explanation of the parts:

  • class="mw-collapsible": Designates that the "div" or section of text is collapsible. Is required.
  • "mw-collapsed": A second class name that sets the element to collapsed when page loads. Leave out if you want the element to be entirely expanded when the page loads. Optional.
  • style="...": set the CSS styling of the entire element. Ideally this CSS is set site-wide in a master CSS stylesheet, but barring that the CSS here will apply (and in fact will override site-wide styling).
  • <div ...>GM Notes</div>: The title of the collapsed element, which will remain visible when collapsed. Required.
  • <div class="mw-collapsible-content">The iron lockbox is actually a mimic.</div>: The content that is collapsed or revealed.
  • {{Lorem}}: This is just a template for Lorem Ipsum text, used as filler nonsense to fill in space. Don't include in your code.