Template:Collapse: Difference between revisions
From charlesreid1
No edit summary |
No edit summary |
||
| Line 45: | Line 45: | ||
{{Collapse|1=Discussion text to be put into box.|padding=20px}} | {{Collapse|1=Discussion text to be put into box.|padding=20px}} | ||
==More Details== | |||
==TemplateData== | |||
{{TemplateData header}} | |||
<templatedata> | |||
{ | |||
"description": "Creates a collapsible box that allows its content to be hidden or revealed on user's command. It is used to reduce clutter.", | |||
"params": { | |||
"1": { | |||
"label": "Contents", | |||
"description": "Contents of the box", | |||
"type": "content", | |||
"required": true, | |||
"aliases": [ | |||
"content", | |||
"text" | |||
] | |||
}, | |||
"2": { | |||
"label": "Title", | |||
"description": "Text of title bar. Defaults to \"Extended contents\".", | |||
"type": "string", | |||
"suggested": true, | |||
"aliases": [ | |||
"title", | |||
"heading", | |||
"header", | |||
"reason", | |||
"result" | |||
], | |||
"default": "Extended content" | |||
}, | |||
"expand": { | |||
"label": "Expanded by default?", | |||
"description": "Setting to \"yes\" (or \"y\", \"expand\", \"expanded\", \"uncollapse\", or \"uncollapsed\") will cause the box to show its contents by default. Any other value (and omitting this parameter) causes the box to be expanded by default. If not set or set to another value (e.g. \"no\") the box will be collapsed by default (its contents hidden).", | |||
"type": "string", | |||
"default": "no" | |||
}, | |||
"border": { | |||
"label": "Border width", | |||
"description": "Width of the outermost border. Accepts a number (e.g. 2) followed immediately with a CSS-compatible unit of measurement. (e.g. \"px\") Example: 2px.", | |||
"type": "string", | |||
"default": "1px" | |||
}, | |||
"bg": { | |||
"label": "Title bar's color", | |||
"description": "Color of the title bar. Can be set any valid CSS color value but please take care that text would remain black.", | |||
"type": "string", | |||
"aliases": [ | |||
"background" | |||
], | |||
"default": "#F0F2F5" | |||
}, | |||
"padding": { | |||
"label": "Padding", | |||
"description": "Width of the padding, the empty space between border and the contents. Accepts a number (e.g. 2) followed immediately with a CSS-compatible unit of measurement. (e.g. \"px\") Example: 2px.", | |||
"default": "8px" | |||
}, | |||
"bg1": { | |||
"label": "Outer background", | |||
"description": "Color of the space between the inner and outer border. Can be set to any valid CSS color.", | |||
"type": "string", | |||
"default": "transparent" | |||
}, | |||
"b-color": { | |||
"label": "Outer border color", | |||
"description": "Color of the outer border. Can be any valid CSS color.", | |||
"type": "string", | |||
"default": "silver" | |||
}, | |||
"width": { | |||
"label": "Collapse box width", | |||
"description": "The width of the entire collapsed box.", | |||
"type": "string", | |||
"default": "100%" | |||
}, | |||
"center": { | |||
"label": "Center-align title", | |||
"description": "If set to any value, the title will be centered.", | |||
"type": "boolean" | |||
}, | |||
"fc": { | |||
"label": "Font color", | |||
"description": "Font color for the title. Also sets the color of the [show]/[hide] link. Can be any valid CSS color", | |||
"type": "string" | |||
}, | |||
"class": { | |||
"label": "CSS class", | |||
"description": "Additional CSS class to add", | |||
"type": "string" | |||
}, | |||
"float": { | |||
"label": "CSS float", | |||
"description": "CSS float, one of \"left\", \"right\", \"none\", \"center\"/\"centre\", or blank.", | |||
"type": "string" | |||
}, | |||
"clear": { | |||
"label": "CSS clear", | |||
"description": "CSS clear value. The default depends on the selected float. Usually one of \"none\", \"left\", \"right\", or \"both\"", | |||
"type": "string" | |||
}, | |||
"left": { | |||
"label": "Left-align title", | |||
"description": "Left-aligns the title. Takes precedence over center.", | |||
"type": "boolean" | |||
}, | |||
"border2": { | |||
"label": "Content border", | |||
"description": "CSS border styling to add to the content.", | |||
"type": "string", | |||
"default": "1px silver" | |||
}, | |||
"bg2": { | |||
"label": "Content background color", | |||
"description": "Background color to use for expanded content.", | |||
"type": "string", | |||
"default": "white" | |||
} | |||
} | |||
} | |||
</templatedata> | |||
</noinclude> | </noinclude> | ||
Revision as of 21:28, 16 November 2019
| Extended 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.
Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst. Fusce convallis, mauris imperdiet gravida bibendum, nisl turpis suscipit mauris, sed placerat ipsum urna sed risus. In convallis tellus a mauris. Curabitur non elit ut libero tristique sodales. Mauris a lacus. Donec mattis semper leo. In hac habitasse platea dictumst. Vivamus facilisis diam at odio. Mauris dictum, nisi eget consequat elementum, lacus ligula molestie metus, non feugiat orci magna ac sem. Donec turpis. Donec vitae metus. Morbi tristique neque eu mauris. Quisque gravida ipsum non sapien. Proin turpis lacus, scelerisque vitae, elementum at, lobortis ac, quam. Aliquam dictum eleifend risus. In hac habitasse platea dictumst. Etiam sit amet diam. Suspendisse odio. Suspendisse nunc. In semper bibendum libero. |
(insert documentation here...)
Example usage
Specify Contents and Title
To specify the contents of the collapsed box, use 1=Contents of collapse.
To specify the text inside the collapsed box, use 2=Click me to see the text.
{{Collapse|1=Contents of collapse|2=Click me to see the text}}
| Click me to see the text |
|---|
|
Contents of collapse
|
Specify style
Specify background color with bg=#XYZ:
{{Collapse|1=Discussion text to be put into box.|bg=#F0F2F5}}
| Extended content |
|---|
|
Discussion text to be put into box.
|
Specify amount of padding with padding=:
{{Collapse|1=Discussion text to be put into box.|padding=20px}}
| Extended content |
|---|
|
Discussion text to be put into box.
|
More Details
TemplateData
Template:TemplateData header <templatedata> { "description": "Creates a collapsible box that allows its content to be hidden or revealed on user's command. It is used to reduce clutter.", "params": { "1": { "label": "Contents", "description": "Contents of the box", "type": "content", "required": true, "aliases": [ "content", "text" ] }, "2": { "label": "Title", "description": "Text of title bar. Defaults to \"Extended contents\".", "type": "string", "suggested": true, "aliases": [ "title", "heading", "header", "reason", "result" ], "default": "Extended content" }, "expand": { "label": "Expanded by default?", "description": "Setting to \"yes\" (or \"y\", \"expand\", \"expanded\", \"uncollapse\", or \"uncollapsed\") will cause the box to show its contents by default. Any other value (and omitting this parameter) causes the box to be expanded by default. If not set or set to another value (e.g. \"no\") the box will be collapsed by default (its contents hidden).", "type": "string", "default": "no" }, "border": { "label": "Border width", "description": "Width of the outermost border. Accepts a number (e.g. 2) followed immediately with a CSS-compatible unit of measurement. (e.g. \"px\") Example: 2px.", "type": "string", "default": "1px" }, "bg": { "label": "Title bar's color", "description": "Color of the title bar. Can be set any valid CSS color value but please take care that text would remain black.", "type": "string", "aliases": [ "background" ], "default": "#F0F2F5" }, "padding": { "label": "Padding", "description": "Width of the padding, the empty space between border and the contents. Accepts a number (e.g. 2) followed immediately with a CSS-compatible unit of measurement. (e.g. \"px\") Example: 2px.", "default": "8px" }, "bg1": { "label": "Outer background", "description": "Color of the space between the inner and outer border. Can be set to any valid CSS color.", "type": "string", "default": "transparent" }, "b-color": { "label": "Outer border color", "description": "Color of the outer border. Can be any valid CSS color.", "type": "string", "default": "silver" }, "width": { "label": "Collapse box width", "description": "The width of the entire collapsed box.", "type": "string", "default": "100%" }, "center": { "label": "Center-align title", "description": "If set to any value, the title will be centered.", "type": "boolean" }, "fc": { "label": "Font color", "description": "Font color for the title. Also sets the color of the [show]/[hide] link. Can be any valid CSS color", "type": "string" }, "class": { "label": "CSS class", "description": "Additional CSS class to add", "type": "string" }, "float": { "label": "CSS float", "description": "CSS float, one of \"left\", \"right\", \"none\", \"center\"/\"centre\", or blank.", "type": "string" }, "clear": { "label": "CSS clear", "description": "CSS clear value. The default depends on the selected float. Usually one of \"none\", \"left\", \"right\", or \"both\"", "type": "string" }, "left": { "label": "Left-align title", "description": "Left-aligns the title. Takes precedence over center.", "type": "boolean" }, "border2": { "label": "Content border", "description": "CSS border styling to add to the content.", "type": "string", "default": "1px silver" }, "bg2": { "label": "Content background color", "description": "Background color to use for expanded content.", "type": "string", "default": "white" } } } </templatedata>