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
(section)
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!
== 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.
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)