Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
TheOpenRoad Support
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template:Collapse/doc
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> {{High-use}} {{Collapsible templates}} The {{tlx|collapse|<nowiki>folding text</nowiki>}} template is used for placing collapse boxes around ''short'' discussions and bits of discussions. To fold ''long'' discussion threads, use {{tlx|Collapse top}}<code>... lots of text ...</code>{{tlx|Collapse bottom}}. There are cases where these template will not work. See [[Help:Collapsing]] for other options. This template should only be used in accordance with the [[Wikipedia:refactoring talk pages]] guideline; it should never be used to end a discussion over the objections of other editors, except in cases of unambiguous disruptive editing. Do not hide content in articles. This violates the [[WP:Manual of Style#Scrolling lists and collapsible content]] and [[WP:Accessibility]] guidelines. == Usage == {{Tlx|Collapse|1=<var>Discussion text to be put into box.</var>|2=<var>Optional custom heading</var>}} It is definitely safest to use the named {{para|1}} and {{para|2}} parameters, because otherwise any "=" character will break the template. For compatibility with various discussion-boxing and -closing, and discussion-wrapping templates, {{para|1}} can also be given as {{para|content}} or {{para|text}}, and {{para|2}} can also be given as {{para|title}}, {{para|reason}}, {{para|header}}, {{para|heading}}, or {{para|result}}. This works with collapsed bulleted list (the first bullet will look correct):<br> {{Tlx|Collapse|title=|Bulleted list}} Start bulleted list on a new line. === HTML version === If you find that the template does not function properly in a particular circumstance, this is most likely because the wikitext table markup (<code><nowiki>{|</nowiki></code>, etc.) only works when it is at the beginning of a new line. A workaround for this is to use the "pure HTML" variant of this template, '''{{tlx|Collapse/HTML}}''', which supports the same parameters but utilizes {{tag|table|o}} tags in lieu of wiki markup for the table layout. === The <code>bg</code> parameter === The <code>bg</code> parameter is optional. It changes the background color. Use [[Web color]] values (e.g. <code>#F0F2F5</code>). ;Example: <code>{<nowiki />{Collapse|1=<var>Discussion text to be put into box.</var>|bg=#F0F2F5}<nowiki />}</code> creates: {{Collapse|1=Discussion text to be put into box.|bg=#F0F2F5}} === The <code>padding</code> parameter === The <code>padding</code> parameter adjusts the amount of cell padding (defaults to <code>8px</code>): <code>{<nowiki />{Collapse|1=<var>Discussion text to be put into box.</var>|padding=20px}<nowiki />}</code> creates the following (expand the box to see the border padding effect): {{Collapse|1=Discussion text to be put into box.|padding=20px}} === The <code>float</code> parameter === The <code>float</code> parameter allows the collapsed content to float to the left, right, or center of the page (defaults to <code>none</code> with <code>width = 100%</code>): <code><nowiki>{{</nowiki>Collapse|1=<var>Discussion text to be put into box.</var>|float=center<nowiki>}}</nowiki></code> creates the following: {{Collapse|1=Discussion text to be put into box.|float=center}} <code><nowiki>{{</nowiki>Collapse|1=<var>Discussion text to be put into box.</var>|float=center|width=30em<nowiki>}}</nowiki></code> creates the following: {{Collapse|1=Discussion text to be put into box.|float=center|width=30em}} <code><nowiki>{{</nowiki>Collapse|1=<var>Discussion text to be put into box.</var>|float=left|width=30em<nowiki>}}</nowiki></code> creates the following: {{Collapse|1=Discussion text to be put into box.|float=left|width=30em}} {{clear}} <code><nowiki>{{</nowiki>Collapse|1=<var>Discussion text to be put into box.</var>|float=right|width=30em<nowiki>}}</nowiki></code> creates the following: {{Collapse|1=Discussion text to be put into box.|float=right|width=30em}} {{clear}} <code><nowiki>{{</nowiki>Collapse|1=<var>Discussion text to be put into box.</var>|float=none|width=30em<nowiki>}}</nowiki></code> creates the following: {{Collapse|1=Discussion text to be put into box.|float=none|width=30em}} === Around header text === When used with a section of text, include the section header in the collapsed portion of text. For example, given: {| style="background-color: lavender;color:inherit;" | Example text|== [[Help:Section|Heading]] ==<br />{{Lorem ipsum}} |} Replace with: {{mono|{{Tlsp|Collapse|1={{Lorem ipsum}}|2=[[Help:Section|Heading]]}}}} ===The <code>expand</code> parameter=== Simply add {{para|expand|yes}} to have the box show up in expanded form with a "hide" link, instead of collapsed form with a "show" link. Other options: {{para|expand|}} <code>yes, y, expand, expanded, uncollapse, uncollapsed</code>. Note: {{para|expand|no}} will fold the box (default). ===The <code>clear</code> parameter=== In some situations you may not want the default <code>clear: both;</code> CSS to apply, which puts the collapse box below any left- or right-floated content within the same HTML block. In this case, you can use {{para|clear|none}}, {{para|clear|right}}, or {{para|clear|left}}, as needed. ===When content includes tables=== This template frequently breaks when used around content that consists of or includes [[Help:Table|wikitables]]. Such content can be made collapsible by using the {{tlx|collapse top}} and {{tlx|collapse bottom}} templates instead of {{tlx|collapse}}. If you want to collapse only the table and not other content, you can do this using wikitable parameters. See the [[Help:Collapsing#Collapsing tables by default|Collapsing tables]] guide for help. ==Limitations== {{transcluded section|source=Help:Collapsing#Limitations}} {{#section-h:Help:Collapsing|Limitations}} ==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" }, "fc2": { "label": "Font color for inside box", "description": "The color of the font inside the collapsed box. Can be any valid CSS color.", "example": "inherit", "type": "string" } } } </templatedata> == Re-using at other wikis == This template depends upon using the three classes <code>mw-collapsible</code>, <code>mw-uncollapsed</code> and <code>mw-collapsed</code>, which are part of MediaWiki versions β₯ 1.18. For wikis using these version of MediaWiki, this template can simply be exported and then imported into another MediaWiki installation. This template transcludes {{tl|main other}} and {{tl|lorem ipsum}}, which should also be imported at the same time. Some changes to the source code will need to be made in order for this template to become usable on the Main/Article (ns:0) [[mw:Help:Namespaces|namespace]]. The toggle text can be edited at external Wiki's [[MediaWiki:Collapsible-expand]] and [[MediaWiki:Collapsible-collapse]] pages. Further information at [[mw:ResourceLoader/Modules#jquery.makeCollapsible|jquery.makeCollapsible module]]. == See also == * {{tl|Collapse top}} and {{tl|Collapse bottom}} * {{tl|discussion top}} * {{tl|hidden}} {{templates for archiving|state=expanded}} <includeonly>{{sandbox other|| <!-- Categories below this line; interwikis at Wikidata --> [[Category:Wikipedia archived wrapper templates]] [[Category:Collapse templates]] }}</includeonly>
Summary:
Please note that all contributions to TheOpenRoad Support may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TheOpenRoad Support:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Absolute page title
(
edit
)
Template:Aligned table
(
edit
)
Template:Clear
(
edit
)
Template:Collapse
(
edit
)
Template:Collapsible templates
(
edit
)
Template:Documentation subpage
(
edit
)
Template:Helpbox
(
edit
)
Template:Helpbox/styles.css
(
edit
)
Template:High-use
(
edit
)
Template:Hlist/styles.css
(
edit
)
Template:Icon
(
edit
)
Template:Ifsubst
(
edit
)
Template:Lorem ipsum
(
edit
)
Template:Mbox
(
edit
)
Template:Mono
(
edit
)
Template:Mono/styles.css
(
edit
)
Template:Navbox
(
edit
)
Template:Para
(
edit
)
Template:Plainlist
(
edit
)
Template:Sidebar
(
edit
)
Template:Strong
(
edit
)
Template:Tag
(
edit
)
Template:TemplateData header
(
edit
)
Template:Template link universal
(
edit
)
Template:Template link with subst
(
edit
)
Template:Templates for archiving
(
edit
)
Template:Terminate sentence
(
edit
)
Template:Tl
(
edit
)
Template:Tls
(
edit
)
Template:Tlsp
(
edit
)
Template:Tlu
(
edit
)
Template:Tlx
(
edit
)
Template:Transcluded section
(
edit
)
Template:Yesno-no
(
edit
)
Module:Aligned table
(
edit
)
Module:Arguments
(
edit
)
Module:Hatnote
(
edit
)
Module:Hatnote/styles.css
(
edit
)
Module:High-use
(
edit
)
Module:Icon
(
edit
)
Module:Icon/data
(
edit
)
Module:Lorem ipsum
(
edit
)
Module:Lorem ipsum/data
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Navbar
(
edit
)
Module:Navbar/configuration
(
edit
)
Module:Navbar/styles.css
(
edit
)
Module:Navbox
(
edit
)
Module:Navbox/configuration
(
edit
)
Module:Navbox/styles.css
(
edit
)
Module:Sidebar
(
edit
)
Module:Sidebar/configuration
(
edit
)
Module:Sidebar/styles.css
(
edit
)
Module:TableTools
(
edit
)
Module:Template link general
(
edit
)
Module:Text
(
edit
)
Module:Text/data
(
edit
)
Module:Transclusion count
(
edit
)
Module:Transclusion count/data/C
(
edit
)
Module:Yesno
(
edit
)