Psuvillager (talk | contribs) (Moved the code to this properly named `Template:` page.) |
Psuvillager (talk | contribs) (Cleanup) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude> |
|||
<span><h2 style="display: inline; margin: none; border: none;">{{title}}{</h2><span>{{summary}}</span></span> |
|||
⚫ | |||
<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 /> |
|||
<!-- Docs: www.mediawiki.org/wiki/Extension:TemplateData --> |
|||
<templatedata> |
|||
<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 /> |
|||
"description": "This template adds a collapsible text block, under a level-2 header with optional summary text.", |
|||
<small>(borders for demo only)</small> |
|||
"params": { |
|||
<div style="border: 1px solid grey"> |
|||
"title": { |
|||
{{Collapsible Section|my content|my title}} |
|||
"label": "Header", |
|||
</div> |
|||
"description": "Section name", |
|||
"required": false, |
|||
<br /><br /> |
|||
"suggested": true, |
|||
"deprecated": false, |
|||
When this description was last updated, the markup looked like this: |
|||
"aliases": ["1"], |
|||
<code> |
|||
"default": null, |
|||
<nowiki><div class="mw-collapsible"></nowiki><br /> |
|||
"example": "My Section", |
|||
<nowiki><span mw-collapsible-toggle-placeholder></span></nowiki><br /> |
|||
"type": "string" |
|||
<nowiki>{{{2}}}</nowiki><br /> |
|||
}, |
|||
<nowiki><div class="mw-collapsible-content">{{{1}}}</div></nowiki><br /> |
|||
"summary": { |
|||
<nowiki></div></nowiki></code> |
|||
"label": "Summary", |
|||
"description": "Optional summary text (always visible)", |
|||
</noinclude> |
|||
"required": false, |
|||
"suggested": false, |
|||
<includeonly> |
|||
"aliases": ["2"], |
|||
"example": ", which has this great summary", |
|||
<div class="mw-collapsible"> |
|||
"type": "string" |
|||
<span mw-collapsible-toggle-placeholder></span> |
|||
}, |
|||
{{{2}}} |
|||
"details": { |
|||
⚫ | |||
"label": "Details", |
|||
{{{1}}} |
|||
"description": "Collapsed text", |
|||
</div> |
|||
"required": false, |
|||
</div> |
|||
"suggested": true, |
|||
"aliases": ["3"], |
|||
</includeonly> |
|||
"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. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", |
|||
"type": "string" |
|||
} |
|||
}, |
|||
"paramOrder": [ |
|||
"title", "summary", "details" |
|||
], |
|||
"sets": [ |
|||
{ |
|||
"label": "group of related parameters", |
|||
"params": ["title", "summary", "details"] |
|||
} |
|||
], |
|||
"format": "inline", |
|||
"maps": {} |
|||
} |
|||
</templatedata> |
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>