Template
Collapsed text
From Dogcraft Wiki
(Created page with "<includeonly><div class="mw-collapsible" id="mw-customcollapsible-{{{1|{{{name|}}}}}}" style="margin-top:1rem;"><div class="mw-customtoggle-{{{1|{{{name|}}}}}}" style="float:right"><span class="mw-collapsible" id="mw-customcollapsible-{{{1|{{{name|}}}}}}" style="color:darkgray">'''{{fa|eye-slash}} {{{hide|Hide}}}'''</span></div>{{{2|{{{content|}}}}}}</div><div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-{{{1|{{{name|}}}}}}"><center><span class="mw-custom...") |
mNo edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><div class="mw-collapsible" id="mw-customcollapsible-{{{1|{{{name|}}}}}}" style="margin-top:1rem;"><div class="mw-customtoggle-{{{1|{{{name|}}}}}}" style="float:right"><span class="mw-collapsible" id="mw-customcollapsible-{{{1|{{{name|}}}}}}" style="color:darkgray">'''{{fa|eye-slash}} {{{hide|Hide}}}'''</span></div>{{{2|{{{content|}}}}}}</div><div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-{{{1|{{{name|}}}}}}"><center><span class="mw-customtoggle-{{{1|{{{name|}}}}}}" style="color:darkgray">'''{{fa|eye}} {{{show|Show}}}'''</span></center></div></includeonly><noinclude> | <includeonly><div class="mw-collapsible" id="mw-customcollapsible-{{{1|{{{name|}}}}}}" style="margin-top:1rem;"><div class="mw-customtoggle-{{{1|{{{name|}}}}}}" style="float:right"><span class="mw-collapsible" id="mw-customcollapsible-{{{1|{{{name|}}}}}}" style="color:darkgray">'''{{fa|eye-slash}} {{{hide|Hide}}}'''</span></div>{{{2|{{{content|}}}}}}</div><div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-{{{1|{{{name|}}}}}}"><center><span class="mw-customtoggle-{{{1|{{{name|}}}}}}" style="color:darkgray">'''{{fa|eye}} {{{show|Show}}}'''</span></center></div></includeonly><noinclude> | ||
{{ | |||
{{Collapsed text|name=example|content=text}} | ==Template documentation== | ||
This template can wrap a paragraph or multiple paragraphs of text in a custom collapsible box, using mediawiki's built-in collapsible tools. This collapsible box is open by default. This custom box will have an iconed close button in the top right corner while open, and will have a centered iconed open button replace the entire content when closed. | |||
<div class="mw-collapsible mw-collapsed"> | |||
=== Syntax === | |||
<div class="mw-collapsible-content">{{template journal | Collapsed text | name (alias: 1) | content (alias: 2) | show | hide }} | |||
The following parameters are required: | |||
* The {{para|name}} parameter is the collapsible section's name. Its not visible, but it should be unique per page. This '''must''' be a single word, use camelCase, "_" or "-" instead of spaces if necessary. If there are two collapsible sections with the same name on the same page, the buttons will toggle both of them. (Because the name is how they tell the difference) The first unnamed parameter also works as an alias for this one. | |||
* The {{para|content}} parameter contains whatever should be collapsed. The second unnamed parameter also works as an alias for this one. | |||
Using optional parameters, the text of the opening and closing buttons can be customised. | |||
* {{para|hide}} this parameter sets the text for the button which hides the content, defaults to "Hide". | |||
* {{para|show}} this parameter sets the text for the button which shows the content again after it has been hidden, defaults to "Show" and is initially hidden (until the content gets hidden) | |||
</div></div> | |||
===Example=== | |||
<code><nowiki>{{Collapsed text | |||
|name=example | |||
|content=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.}}</nowiki></code> generates: | |||
{{Collapsed text | |||
|name=example | |||
|content=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.}} | |||
With custom hide/show buttons: | |||
<code><nowiki>{{Collapsed text | |||
|name=example2 | |||
|hide=Vanish | |||
|show=Appear text | |||
|content=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.}}</nowiki></code> generates: | |||
{{Collapsed text | |||
|name=example2 | |||
|hide=Vanish | |||
|show=Appear text | |||
|content=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.}} | |||
[[Category:Formatting templates]] | |||
==TemplateData== | |||
<templatedata> | |||
{ | |||
"params": { | |||
"name": { | |||
"aliases": [ | |||
"1" | |||
], | |||
"label": "Name", | |||
"description": "This is as the collapsible section's name. Its not visible, but it should be unique per page. This '''must''' be a single word, use camelCase, '_' or '-' instead of spaces if necessary. If there are two collapsible sections with the same name on the same page, the buttons will toggle both of them. (Because the name is how they tell the difference)", | |||
"example": "buildings_list", | |||
"type": "string", | |||
"required": true, | |||
"suggested": true | |||
}, | |||
"hide": { | |||
"label": "Hide", | |||
"description": "This parameter sets the text for the button which hides the content, defaults to 'Hide'", | |||
"example": "Vanish", | |||
"type": "string", | |||
"suggested": true, | |||
"default": "Hide" | |||
}, | |||
"content": { | |||
"aliases": [ | |||
"2" | |||
], | |||
"label": "Content", | |||
"description": "This parameter contains whatever should be collapsed. It can be multiple paragraphs, divs, etc.", | |||
"example": "Lorem ipsum dolor sit...", | |||
"type": "string", | |||
"required": true, | |||
"suggested": true | |||
}, | |||
"show": { | |||
"label": "Show", | |||
"description": "This parameter sets the text for the button which shows the content again after it has been hidden, defaults to 'Show' and is initially hidden (until the content gets hidden)", | |||
"example": "Appear", | |||
"type": "string", | |||
"suggested": true, | |||
"default": "Show" | |||
} | |||
}, | |||
"description": "This template can wrap a paragraph or multiple paragraphs of text in a custom collapsible box, using mediawiki's built-in collapsible tools. This collapsible box is open by default. This custom box will have an iconed close button in the top right corner while open, and will have a centered iconed open button replace the entire content when closed.", | |||
"paramOrder": [ | |||
"name", | |||
"content", | |||
"hide", | |||
"show" | |||
], | |||
"format": "block" | |||
} | |||
</templatedata>__NOTOC__ |
Latest revision as of 05:07, 25 January 2025
Template documentation
This template can wrap a paragraph or multiple paragraphs of text in a custom collapsible box, using mediawiki's built-in collapsible tools. This collapsible box is open by default. This custom box will have an iconed close button in the top right corner while open, and will have a centered iconed open button replace the entire content when closed.
Syntax
Example
{{Collapsed text
|name=example
|content=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.}}
generates:
With custom hide/show buttons:
{{Collapsed text
|name=example2
|hide=Vanish
|show=Appear text
|content=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.}}
generates:
TemplateData
This template can wrap a paragraph or multiple paragraphs of text in a custom collapsible box, using mediawiki's built-in collapsible tools. This collapsible box is open by default. This custom box will have an iconed close button in the top right corner while open, and will have a centered iconed open button replace the entire content when closed.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Name | name 1 | This is as the collapsible section's name. Its not visible, but it should be unique per page. This '''must''' be a single word, use camelCase, '_' or '-' instead of spaces if necessary. If there are two collapsible sections with the same name on the same page, the buttons will toggle both of them. (Because the name is how they tell the difference)
| String | required |
Content | content 2 | This parameter contains whatever should be collapsed. It can be multiple paragraphs, divs, etc.
| String | required |
Hide | hide | This parameter sets the text for the button which hides the content, defaults to 'Hide'
| String | suggested |
Show | show | This parameter sets the text for the button which shows the content again after it has been hidden, defaults to 'Show' and is initially hidden (until the content gets hidden)
| String | suggested |