Template:Collapse top/doc: Difference between revisions

m
no edit summary
w:en>Paine Ellsworth
m (update /doc)
w:en>Hildeoc
mNo edit summary
Line 6: Line 6:
{{Template:Collapse Templates}}
{{Template:Collapse Templates}}


The {{tlx|collapse top}} template (or {{tlx|cot}}), and its paired template {{tlx|collapse bottom}} (or {{tlx|cob}}), are used for placing a collapse box around a 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.  
The {{tlx|collapse top}} template (or {{tlx|cot}}), and its paired template {{tlx|collapse bottom}} (or {{tlx|cob}}), are used for placing a collapse box around a 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:Refactoring]] guideline; they should never be used to end a discussion over the objections of other editors, except in cases of unambiguous disruptive editing.
These templates should only be used in accordance with the [[Wikipedia:Refactoring]] guideline; they should never be used to end a discussion over the objections of other editors, except in cases of unambiguous disruptive editing.
Line 37: Line 37:
;{{para|fc}}: Sets the font color of the title of the collapsible bar. Defaults to inheriting the current text color of the context. See {{para|bg}}, above, for details on color options.
;{{para|fc}}: Sets the font color of the title of the collapsible bar. Defaults to inheriting the current text color of the context. See {{para|bg}}, above, for details on color options.
;{{para|border}}: Sets the width of the border line on the collapsed material. defaults to <code>1px</code>. For example, <code><nowiki>{{collapse top|border=2px}}</nowiki></code>; going much thicker than this is not very useful.
;{{para|border}}: Sets the width of the border line on the collapsed material. defaults to <code>1px</code>. For example, <code><nowiki>{{collapse top|border=2px}}</nowiki></code>; going much thicker than this is not very useful.
;{{para|b-color}}: Sets the border color. defaults to <code>Silver</code> (<code>#C0C0C0</code>). See {{para|bg}}, above, for details on color options.
;{{para|b-color}}: Sets the border color. defaults to <code>Silver</code> (<code>#C0C0C0</code>). See {{para|bg}}, above, for details on color options.
;{{para|padding}}: Sets the padding (distance from borders) on the collapsed material inside the colored area. Defaults to <code>0.6em</code>.
;{{para|padding}}: Sets the padding (distance from borders) on the collapsed material inside the colored area. Defaults to <code>0.6em</code>.
;{{para|width}}: Sets the width of the overall template relative to the page (or a block element containing the collapse box). This should virtually always be given as a percentage, e.g. {{para|width|50%}}, or in relative <samp>em</samp> units, e.g. {{para|width|30em}}. Pixel-based values should be avoided, as they are effectively meaningless – the result will be different depending on each user's browser and local CSS settings (which browser and operating system it is, zoom level, font sizes, etc.).
;{{para|width}}: Sets the width of the overall template relative to the page (or a block element containing the collapse box). This should virtually always be given as a percentage, e.g. {{para|width|50%}}, or in relative <samp>em</samp> units, e.g. {{para|width|30em}}. Pixel-based values should be avoided, as they are effectively meaningless – the result will be different depending on each user's browser and local CSS settings (which browser and operating system it is, zoom level, font sizes, etc.).
;{{para|border2}}: Sets the properties of the border of the box that appears when template is expanded; defaults to <code>1px Silver</code> (there is no provision to change from a solid line). For example, <code><nowiki>{{collapse top|border2=2px}}</nowiki></code> (only width or color will be changed if only one value is supplied).  See {{para|bg}}, above, for details on color options.
;{{para|border2}}: Sets the properties of the border of the box that appears when template is expanded; defaults to <code>1px Silver</code> (there is no provision to change from a solid line). For example, <code><nowiki>{{collapse top|border2=2px}}</nowiki></code> (only width or color will be changed if only one value is supplied).  See {{para|bg}}, above, for details on color options.
;{{para|bg2}}: Sets the background color of the box that appears when template is expanded; defaults to <code>White</code> (<code>#FFFFFF</code>). See {{para|bg}}, above, for details on color options.
;{{para|bg2}}: Sets the background color of the box that appears when template is expanded; defaults to <code>White</code> (<code>#FFFFFF</code>). See {{para|bg}}, above, for details on color options.
;{{para|indent}}: Indents the box from the left of the page. Defaults to no indentation. Each <code>:</code> in talk page markup is approximately equivalent to <code>1.6em</code> of indent (e.g., to match <code>::::</code> indentation level, use {{para|indent|6.4em}}. You can also use a percentage value. Pixel-based values should be avoided (see {{para|width}}, above, for why).
;{{para|indent}}: Indents the box from the left of the page. Defaults to no indentation. Each <code>:</code> in talk page markup is approximately equivalent to <code>1.6em</code> of indent (e.g., to match <code>::::</code> indentation level, use {{para|indent|6.4em}}. You can also use a percentage value. Pixel-based values should be avoided (see {{para|width}}, above, for why).
;{{para|clear}}: In some situations you may not want the default <code>clear: both;</code> CSS to apply, with 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.
;{{para|clear}}: In some situations you may not want the default <code>clear: both;</code> CSS to apply, with 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.


== Examples ==
== Examples ==
* Adding a box title (if omitted, default is 'Extended content') - <code><nowiki>{{collapse top|This is the title text}}</nowiki></code>
* Adding a box title (if omitted, default is 'Extended content') <code><nowiki>{{collapse top|This is the title text}}</nowiki></code>
{{collapse top|This is the title text}}
{{collapse top|This is the title text}}
{{lorem ipsum}}
{{lorem ipsum}}
{{collapse bottom}}
{{collapse bottom}}
* Adding a standard warning line - <code><nowiki>{{collapse top|This is the title text|warning=true}}</nowiki></code>
* Adding a standard warning line <code><nowiki>{{collapse top|This is the title text|warning=true}}</nowiki></code>
{{collapse top|This is the title text|warning=true}}
{{collapse top|This is the title text|warning=true}}
{{lorem ipsum}}
{{lorem ipsum}}
{{collapse bottom}}
{{collapse bottom}}
* Adding a custom warning line - <code><nowiki>{{collapse top|This is the title text|This is a custom warning line}}</nowiki></code>
* Adding a custom warning line <code><nowiki>{{collapse top|This is the title text|This is a custom warning line}}</nowiki></code>
{{collapse top|This is the title text|This is a custom warning line}}
{{collapse top|This is the title text|This is a custom warning line}}
{{lorem ipsum}}
{{lorem ipsum}}
{{collapse bottom}}
{{collapse bottom}}
* Aligning box title along left margin - <code><nowiki>{{collapse top|left=true}}</nowiki><!-- or {{collapse top|left=true}}--><nowiki></nowiki></code>
* Aligning box title along left margin <code><nowiki>{{collapse top|left=true}}</nowiki><!-- or {{collapse top|left=true}}--><nowiki></nowiki></code>
{{collapse top|left=true}}
{{collapse top|left=true}}
{{lorem ipsum}}
{{lorem ipsum}}
{{collapse bottom}}
{{collapse bottom}}
* Changing background color - <code><nowiki>{{collapse top|bg=#F0F2F5}}</nowiki></code>
* Changing background color <code><nowiki>{{collapse top|bg=#F0F2F5}}</nowiki></code>
{{collapse top|bg=#F0F2F5}}
{{collapse top|bg=#F0F2F5}}
{{lorem ipsum}}
{{lorem ipsum}}
{{collapse bottom}}
{{collapse bottom}}
* Adding extra padding - <code><nowiki>{{collapse top|padding=5em}}</nowiki></code>
* Adding extra padding <code><nowiki>{{collapse top|padding=5em}}</nowiki></code>
{{collapse top|padding=5em}}
{{collapse top|padding=5em}}
{{lorem ipsum}}
{{lorem ipsum}}
Line 75: Line 75:
Sample contents text
Sample contents text
{{collapse bottom}}</pre>
{{collapse bottom}}</pre>
must be rewritten as:  
must be rewritten as:
<pre>{{collapse top|Section header}}
<pre>{{collapse top|Section header}}
Sample contents text
Sample contents text
Line 112: Line 112:
[[Category:Archival templates]]
[[Category:Archival templates]]
[[Category:Collapse templates]]
[[Category:Collapse templates]]
}}</includeonly>
}}</includeonly>
Anonymous user