Template:Collapse: Difference between revisions

From Space Station 14 Wiki
(Created page with "<includeonly><!-- --><div class="mw-collapsible {{#if: {{{collapsed|1}}}|mw-collapsed}}" style="{{{style|}}}">{{{1}}}</div></includeonly><noinclude> {{documentation}} Category:Markup templates <templatedata> { "params": { "1": { "label": "Content", "description": "Content inside the box.", "type": "string", "required": true }, "collapsed": { "label": "Is collapsed by default?", "type": "boolean", "default": "1", "suggested": true...")
 
(expand collapse button positioning customization)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
# template styles
--><templatestyles src="/styles.css" /><!--
# template
--><div  
--><div  
   class="mw-collapsible {{#if: {{{collapsed|1}}}|mw-collapsed}}"  
   class="
    mw-collapsible  
    {{#if: {{{collapsed|1}}}|mw-collapsed}}
    expand-collapse-button-float-{{{button float|left}}}"
   style="{{{style|}}}">{{{1}}}</div></includeonly><noinclude>
   style="{{{style|}}}">{{{1}}}</div></includeonly><noinclude>
{{documentation}}
{{documentation}}
Line 25: Line 32:
"example": "width: 10rem;",
"example": "width: 10rem;",
"type": "string",
"type": "string",
"suggested": true
},
"button float": {
"label": "Button float",
"description": "Placement for the \"Expand/Collapse\" button using float.",
"type": "string",
"suggestedvalues": [
"left",
"right",
"none"
],
"default": "left",
"suggested": true
"suggested": true
}
}
Line 32: Line 51:
"1",
"1",
"collapsed",
"collapsed",
"style"
"style",
"button float"
]
]
}
}
</templatedata>
</templatedata>
</noinclude>
</noinclude>

Revision as of 15:42, 24 June 2024

Template documentation
view or edit this documentation about template documentation

  • As a separate string of text {{Collapse|text inside!!}}:
Page Template:/styles.css has no content.
text inside!!
  • Inside a string of text Lorem ipsum {{Collapse|text inside!!}} dolor sit amet:
Lorem ipsum Page Template:/styles.css has no content.
text inside!!
dolor sit amet

A template for creating collapsible blocks. By default, takes up the entire width, placing the "Expand/Collapse" button to the right.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Content1

Content inside the box.

Stringrequired
Is collapsed by default?collapsed

no description

Default
1
Booleansuggested
Any custom stylingstyle

no description

Example
width: 10rem;
Stringsuggested
Button floatbutton float

Placement for the "Expand/Collapse" button using float.

Suggested values
left right none
Default
left
Stringsuggested