Difference between revisions of "Collapsible"
(updated default width) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly>{</includeonly><includeonly>{{!}} style="background-color:#1d1d1d; width: {{#if: {{{width|}}}|{{{width}}}| | + | <includeonly>{</includeonly><includeonly>{{!}} style="background-color:#1d1d1d; width: {{#if: {{{width|}}}|{{{width}}}|85}}%;" |
{{!}} | {{!}} | ||
+ | <div class="mw-collapsible mw-{{#ifeq:{{{collapsed|}}}|false|expanded|collapsed}}> | ||
{{#if: {{{header|}}}|==={{{header|}}}===}} | {{#if: {{{header|}}}|==={{{header|}}}===}} | ||
{{{1|}}} | {{{1|}}} | ||
− | <div class="mw-collapsible | + | <div class="mw-collapsible-content"> |
{{{2|}}} | {{{2|}}} | ||
</div> | </div> | ||
Line 9: | Line 10: | ||
<noinclude> | <noinclude> | ||
Creates a box with a collapsible segment. | Creates a box with a collapsible segment. | ||
− | ; | + | <pre> |
− | Sets the box width to a percentage of the site width. Defaults to | + | {{Collapsible |
− | ; | + | |width=85 |
+ | |header=<header title> | ||
+ | |collapsed=true | ||
+ | |<text outside collapsible area> | ||
+ | |<text within collapsible area> | ||
+ | }}</pre> | ||
+ | |||
+ | == Parameters == | ||
+ | ;width | ||
+ | Sets the box width to a percentage of the site width. Defaults to 85%. | ||
+ | ;header | ||
When set, creates a level 3 header within the box, but outside the collapsible segment. | When set, creates a level 3 header within the box, but outside the collapsible segment. | ||
− | ; | + | ;collapsed |
Starts in the expanded state when set to '''false'''. Defaults to the collapsed state when not set or set to any other value, including '''true'''. | Starts in the expanded state when set to '''false'''. Defaults to the collapsed state when not set or set to any other value, including '''true'''. | ||
− | ; | + | ;unnamed parameter 1 |
Holds text outside the collapsible segment, this text will be visible in both expanded and collapsed states | Holds text outside the collapsible segment, this text will be visible in both expanded and collapsed states | ||
− | ; | + | ;unnamed parameter 2 |
holds the text within the collapsible segment. This text will be hidden when the segment is collapsed. Headers in this segment will not work from the Table of Contents when the section is collapsed. | holds the text within the collapsible segment. This text will be hidden when the segment is collapsed. Headers in this segment will not work from the Table of Contents when the section is collapsed. | ||
+ | </noinclude> |
Latest revision as of 16:58, 27 February 2022
Creates a box with a collapsible segment.
{{Collapsible |width=85 |header=<header title> |collapsed=true |<text outside collapsible area> |<text within collapsible area> }}
Parameters
- width
Sets the box width to a percentage of the site width. Defaults to 85%.
- header
When set, creates a level 3 header within the box, but outside the collapsible segment.
- collapsed
Starts in the expanded state when set to false. Defaults to the collapsed state when not set or set to any other value, including true.
- unnamed parameter 1
Holds text outside the collapsible segment, this text will be visible in both expanded and collapsed states
- unnamed parameter 2
holds the text within the collapsible segment. This text will be hidden when the segment is collapsed. Headers in this segment will not work from the Table of Contents when the section is collapsed.
Get MetaBattle Premium
Enjoy an ad-free experience & support the website, for less than $1 per month! Upgrade to Premium
Enjoy an ad-free experience & support the website, for less than $1 per month! Upgrade to Premium