Template:Collapsible div/doc

From Itora Wiki


Description

This template inserts content into collapsible <div> elements.  If you provide only one unnamed parameter, then that text is collapsible.  If you provide two unnamed parameters, then the first is the anchor to which the "[Collapse]" button is attached, and the second is the content that disappears and reappears.

Syntax

{{collapsible div|COLLAPSIBLE}}
{{collapsible div|UNCOLLAPSIBLE|COLLAPSIBLE}}

If the uncollapsible content contains a header (=== '''Header''' ===), then you must first start the header on a new line so the equals sign isn't processed as a parameter identifier.  See "Test Output" example below.

Examples

{{Collapsible div|
=== '''Test Output''' ===
|Here's some test output that includes a header and collapsible content.}}

{{Collapsible div|Here's some test output that includes collapsible content but no header.}}
...produces...

Notes

  • The Visual Editor does not properly handle collapsible divs.  This template was an attempt to provide the same functionality in a way that the Visual Editor wouldn't mangle, but there are limitations to how "user-friendly" templates can be in the VisEd.  For example, the GUI for adding templates to articles does not allow text to be converted to headers, bolded, italicized, or otherwise formatted while it is inside the template.  Thus, this template may not be very useful.