Changes

Template:Collapse top/doc

5,200 bytes added, 14:23, 29 February 2020
Created page with "{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> {{TOCright}} === Description === {{template shortcut|cot|cob|hab}} ''':Tem..."
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
{{TOCright}}
=== Description ===
{{template shortcut|cot|cob|hab}}
'''[[:Template:Collapse top]]''' (shortcut → {{tlx|cot}}) and its paired template, '''[[:Template:Collapse bottom]]''' (shortcut → {{tlx|cob}}), are used for placing a collapse box around a [[Help:talk page|talk page]] discussion, especially when the content contains complex wikimarkup such as tables. For very simple content, the one-piece template {{tlx|collapse}} can be used instead.

These templates should only be used in accordance with the [[wikipedia:Wikipedia:Refactoring|refactoring]] guideline. They should never be used to end a discussion over the objections of other editors, except in cases of unambiguous, [[wikipedia:Wikipedia:disruptive editing|disruptive editing]].

=== Syntax ===
Place {{tlx|collapse top}} and {{tlx|collapse bottom}} around the text to be collapsed.

;Example

<pre>{{Collapse top|title=This is the title text}}
{{lorem ipsum}}
{{Collapse bottom}}</pre>

;:produces:

{{Collapse top|title=This is the title text}}
{{lorem ipsum}}
{{Collapse bottom}}
<br />
==== Parameters ====
This template takes the following parameters, all of which are optional

;{{para|1}} : '''{{para|title}}''' gives the main title to the collapsed box, which occurs on the same line as the <tt>[show]</tt> link and is always visible. It defaults to '''Extended content'''.

;{{para|warning}} : If this parameter evaluates to <tt>true</tt> (i.e., is not <tt>0</tt>, <tt>false</tt>, or <tt>empty</tt>), it will display a default warning line under the main title which reads<blockquote>''The following is an archived debate. <span style="color:red;">'''Please do not modify it.'''</span>''</blockquote>

;{{para|2}} : This is an optional warning-line text. It will override the standard warning line above, and obviate the need for setting the '''{{para|warning}}''' parameter.

;{{para|expand}} : If this parameter evaluates to <tt>true</tt> (i.e., is not <tt>0</tt>, <tt>false</tt>, or <tt>empty</tt>), it will leave the material ''un''collapsed with the border and coloring. Default is to collapse the material.

;{{para|bg}} : Sets the background color of the collapsed material. Defaults to #CFC - <span style="background:#CFC;">a pleasant green</span>. Other colors available at [[wikipedia:Web colors#X11 color names|Web colors]].

;{{para|border}} : Sets the width of the border line of the collapsed material. Defaults to {{para|border|1px}}.

;{{para|b-color}} : Sets the border color. Defaults to {{para|b-color|silver}}.

;{{para|padding}} : Sets the padding on the collapsed material in the colored area. Defaults to {{para|padding|8px}}.

;{{para|width}} : Sets the width of the overall template. Use {{para|width|700px}}, not {{para|<b>W</b>idth|700px}}: Upper case "W" does not work. Additionally, do not omit "px", which also does not work; that is, use {{para|width|700px}} and ''not'' {{para|width|700}}. {{para|width}} can also be expressed as a percent (e.g., {{para|width|100%}})

;{{para|border2}} : Sets the border of the box that appears when template is ''expanded''. Defaults to {{para|border2|1px silver}}. There is no provision to change from a solid line.

;{{para|bg2}} : Sets background of the box that appears when template is ''expanded''. Defaults to {{para|bg2|white}}.
<br />
{{update|Note:}}{{spaces|2}}If an entire [[m:Help:Section|section]] is being archived, remove the section header, and add it as the first parameter (i.e., '''{{para|1}}''') of the template. This keeps the section header from showing in the [[m:Help:TOC#Table of contents (TOC)|table of contents]].
<br /><br />

==== Examples ====

===== Example #1: Background color =====

*changing background color:

{{tlx|collapse top|bg{{=}}#D8BFD8}} <big><b>or</b></big> {{tlx|cot||bg{{=}}#D8BFD8}}

;:produces …

{{cot|bg=#D8BFD8}}
{{lorem ipsum}}
{{cob}}
<br />
===== Example #2: Padding =====

*adding extra padding

{{tlx|cot|padding{{=}}40px}}

;:produces …

{{cot|padding=40px}}
{{lorem ipsum}}
{{cob}}
<br />

===== Example #3: Warning (default) =====

*adding a warning line

{{tlx|cot|default warning|warning{{=}}1}}

;:produces …

{{cot|default warning|warning=1}}
{{lorem ipsum}}
{{cob}}
<br />

===== Example #4: Warning (custom) =====

{{tlx|cot|custom warning|this is a custom warning line}}

;:produces …

{{cot|custom warning|this is a custom warning line}}
{{lorem ipsum}}
{{cob}}
<br />

===== Example #5: Archiving =====

*archiving a section
<pre>{{cot}}
==section header==
text
{{cob}}</pre>

;:rewritten as …

<pre>{{cot|section header}}
text
{{cob}}</pre>

;:produces …

{{cot|section header}}
text
{{cob}}
<br />

=== Redirects ===

==== Collapse top ====

* {{tlx|cot}}
* {{tlx|DAT}}

==== Collapse bottom ====

* {{tlx|cob}}
* {{tlx|hab}}
* {{tlx|hidden archive bottom}}

=== See also ===
{{Collapse templates}}

<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Archival templates|{{PAGENAME}}]]
[[Category:Collapse templates|{{PAGENAME}}]]
</includeonly><noinclude>
{{pp-move|small=yes}}
{{pp-move-indef}}
{{pp-template|small=yes}}</noinclude>