×
Create a new article
Write your page title here:
We currently have 1,780 articles on The Quelmar Wiki. Type your article name above or click on one of the titles below and start writing!



The Quelmar Wiki

Template:Collapsible Section: Difference between revisions

(Simplified, fixed syntax, explicitly included collapsible classes)
(Cleanup)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<div class="mw-collapsible" style="min-height:1.5em">

<div class="collapsible-title">{{{title}}}</div>
<span style="font-size:1.3em">
This template makes a collapsible section with basic formatting, including an optional title. It:
</span>
* Leaves the title (if any) visible when the content is collapsed
* Uses the "mw-collapsible" components explicitly to keep the toggle button from drifting into any subsequent text (<span style="font:1.15em monospace">mw-collapsible-toggle-placeholder</span> and particularly <span style="font:1.15em monospace">mw-collapsible-content</span>.)

<br /><br />

<span style="font-size:1.15em"> Write:</span> <code><nowiki>{{Collapsible Section|my content|my title}}</nowiki></code><br />
<span style="font-size:1.15em">to get:</span><br />
<small>(borders for demo only)</small>
<div style="border: 1px solid grey">
{{Collapsible Section|my content|my title}}
</div>

<br /><br />

When this description was last updated, the markup looked like this:
<code>
<nowiki><div class="mw-collapsible"></nowiki><br />
<nowiki><span mw-collapsible-toggle-placeholder></span></nowiki><br />
<nowiki>{{{2}}}</nowiki><br />
<nowiki><div class="mw-collapsible-content">{{{1}}}</div></nowiki><br />
<nowiki></div></nowiki></code>

</noinclude>

<includeonly>

<div class="mw-collapsible">
<span mw-collapsible-toggle-placeholder></span>
<span mw-collapsible-toggle-placeholder></span>
{{{2}}}
<div class="mw-collapsible-content">
<div class="mw-collapsible-content">
{{{content}}}
{{{1}}}
</div>
</div>
</div>
</div>


</includeonly>
<noinclude>
<!-- Docs: www.mediawiki.org/wiki/Extension:TemplateData -->
<templatedata>
{
"description": "This template adds a collapsible div tall enough for its toggle button. Title is optional; content is required.",
"params": {
"content": {
"label": "content",
"description": "Part that actually collapses",
"required": true,
"aliases": ["1"],
"example": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
"type": "string"
},
"title": {
"label": "title",
"description": "Always visible at top (if included)",
"required": false,
"suggested": false,
"deprecated": false,
"aliases": ["2"],
"default": null,
"example": "My Section",
"type": "string"
}
},
"paramOrder": ["content","title"],
"sets": [{
"label": "group of related parameters",
"params": ["content","title"]
}],
"format": "inline",
"maps": {}
}
</templatedata>
</noinclude>

Latest revision as of 02:41, 18 January 2025


This template makes a collapsible section with basic formatting, including an optional title. It:

  • Leaves the title (if any) visible when the content is collapsed
  • Uses the "mw-collapsible" components explicitly to keep the toggle button from drifting into any subsequent text (mw-collapsible-toggle-placeholder and particularly mw-collapsible-content.)



Write: {{Collapsible Section|my content|my title}}
to get:
(borders for demo only)



my title

my content




When this description was last updated, the markup looked like this:


<div class="mw-collapsible">
<span mw-collapsible-toggle-placeholder></span>
{{{2}}}
<div class="mw-collapsible-content">{{{1}}}</div>
</div>



Cookies help us deliver our services. By using our services, you agree to our use of cookies. (Hi Margarita's Table. 🇩🇪)

Recent changes

  • Spiderjjr45 • Yesterday at 20:56
  • Spiderjjr45 • Yesterday at 20:55
  • Spiderjjr45 • Yesterday at 20:54
  • Spiderjjr45 • Yesterday at 20:53
  • Cookies help us deliver our services. By using our services, you agree to our use of cookies. (Hi Margarita's Table. 🇩🇪)