Template:Collapse top/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Ludwigs2
reorganizing and strengthening
meta>Ludwigs2
revising docs, removing (incomprehensible) timestamp instruction, adding new parameters, examples.
Line 3: Line 3:
{{shortcut|Template:Cot|Template:Cob}}
{{shortcut|Template:Cot|Template:Cob}}


The Collapse template is used for placing collapse boxes around discussions.
The Collapse template is used for placing collapse boxes around discussions.  It is a two-part template, used in conjunction with {{tl|Collapse bottom}} ({{tl|cob}}).


This template should only be used in accordance with the [[Wikipedia:refactoring]] guideline; it should never be used to to end a discussion over the objections of other editors, except in cases of unambiguous disruptive editing.
This template should only be used in accordance with the [[Wikipedia:refactoring]] guideline; it should never be used to to end a discussion over the objections of other editors, except in cases of unambiguous disruptive editing.


== Usage ==
== Usage ==
Place {{tl|Collapse top}} and {{tl|Collapse bottom}} arounf the text to be collapsed.  example:


'''''Note: {{Tl|Collapse top}} and {{Tl|Collapse bottom}} need to be substed in order for the time stamp functionality to work properly.'''''
<pre>{{Collapse top|This is the title text}}
{{lorem ipsum}}
{{Collapse bottom}}</pre>
produces
{{Collapse top|Title text}}
{{lorem ipsum}}
{{Collapse bottom}}


{{Tlp|Collapse top|Optional text|bg|padding}}
== Parameters ==
This template takes the following parameters, all of which are optional


<span style="background:lightyellow;">DISCUSSION</span>
;''positional parameter 1'', named parameter 'title': These parameters give the main title of collapsed box, which occurs on the same line as the ''show'' link and is always visible.  It defaults to 'Extended content'.
;warning: If this parameter evaluates to true (i.e. is not 0, false, or empty) it will display a default warning line under the main title which reads 'The following is an archived debate. <span style="color:red;">'''Please do not modify it.'''</span>'
;''positional parameter 2'': This is optional warning-line text.  It will override the standard warning line above, and obviate the need for setting the 'warning' parameter.
;'expand': If this parameter evaluates to true (i.e. is not 0, false, or empty) it will leave the material uncollapsed with the border and coloring.  Default is to collapse the material.
;'bg': Sets the background color of the collapsed material.  Defaults to #CFC - a pleasant green.
;'border': Sets the width of the border line on the collapsed material.  defaults to 1px.
;'padding': Sets the padding on the collapsed material in the colored area.  defaults to 8 px


{{Tl|Collapse bottom}}
If an entire section is being archived, remove the section header and add it as the first parameter of the template. This keeps the section header from showing in the TOC.
 
== Examples ==
=== The bg parameter ===
 
The bg parameter is Optional. It changes the background color. use [[Web color]] values (e.g. #F0F2F5).
 
;Example:
   
   
<nowiki>{{Collapse top|bg=#F0F2F5}} or {{cot|bg=#F0F2F5}}</nowiki> creates:
*changing background color - <nowiki>{{Collapse top|bg=#F0F2F5}} or {{cot|bg=#F0F2F5}}</nowiki>
 
{{cot|bg=#F0F2F5}}
{{cot|bg=#F0F2F5}}
Text here.
{{lorem ipsum}}
{{cob}}
*adding extra padding - <nowiki>{{cot|padding=40px}}</nowiki>
{{cot|padding=40px}}
{{lorem ipsum}}
{{cob}}
*adding a warning line - <nowiki>{{cot|default warning|warning=1}}</nowiki>, <nowiki>{{cot|custom warning|this is a custom warning line}}</nowiki>
{{cot|default warning|warning=1}}
{{lorem ipsum}}
{{cob}}
{{cot|custom warning|this is a custom warning line}}
{{lorem ipsum}}
*archiving a section
<pre>{{cot}}
==section header==
text
{{cob}}</pre>
rewritten as
<pre>{{cot|section header}}
text
{{cob}}</pre>
{{cot|section header}}
text
{{cob}}
{{cob}}
{{cob}}
=== The padding parameter ===
The padding parameter adjusts the amount of cell padding (defaults to 8px)
=== Around header text ===
When used with a section of text, include the section header in the collapsed portion of text. For example, given:
{{Divbox|green|Example text|&#x3d;&#x3d; [[Help:Section|Heading]] &#x3d;&#x3d;<br />{{Lorem ipsum}}}}
Replace with:
{{Divbox|tt|Changed to|{{Tlsp|Collapse top|[[Help:Section|Heading]]|}}<br />{{Lorem ipsum}}<br />{{Tlsp|Collapse bottom}}}}
===The expand parameter===
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.  use {{para|expand|}} (an empty value) or omit the expand parameter to have the box show up in collapsed form.


==General information==
==General information==
Line 48: Line 64:
== Redirects ==
== Redirects ==
* {{Tl|DAT}}
* {{Tl|DAT}}
* {{tl|hidden archive top}}


== See also ==
== See also ==
Line 54: Line 71:
* {{tl|discussion top}}
* {{tl|discussion top}}
* {{tl|archive top}}
* {{tl|archive top}}
* {{tl|hidden archive top}}


<includeonly>
<includeonly>

Revision as of 18:36, 13 March 2010

The Collapse template is used for placing collapse boxes around discussions. It is a two-part template, used in conjunction with {{Collapse bottom}} ({{cob}}).

This template should only be used in accordance with the Wikipedia:refactoring guideline; it should never be used to to end a discussion over the objections of other editors, except in cases of unambiguous disruptive editing.

Usage

Place {{Collapse top}} and {{Collapse bottom}} arounf the text to be collapsed. example:

{{Collapse top|This is the title text}}
{{lorem ipsum}}
{{Collapse bottom}}

produces

Title text

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.

Parameters

This template takes the following parameters, all of which are optional

positional parameter 1, named parameter 'title'
These parameters give the main title of collapsed box, which occurs on the same line as the show link and is always visible. It defaults to 'Extended content'.
warning
If this parameter evaluates to true (i.e. is not 0, false, or empty) it will display a default warning line under the main title which reads 'The following is an archived debate. Please do not modify it.'
positional parameter 2
This is optional warning-line text. It will override the standard warning line above, and obviate the need for setting the 'warning' parameter.
'expand'
If this parameter evaluates to true (i.e. is not 0, false, or empty) it will leave the material uncollapsed with the border and coloring. Default is to collapse the material.
'bg'
Sets the background color of the collapsed material. Defaults to #CFC - a pleasant green.
'border'
Sets the width of the border line on the collapsed material. defaults to 1px.
'padding'
Sets the padding on the collapsed material in the colored area. defaults to 8 px

If an entire section is being archived, remove the section header and add it as the first parameter of the template. This keeps the section header from showing in the TOC.

Examples

  • changing background color - {{Collapse top|bg=#F0F2F5}} or {{cot|bg=#F0F2F5}}
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.

  • adding extra padding - {{cot|padding=40px}}
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.

  • adding a warning line - {{cot|default warning|warning=1}}, {{cot|custom warning|this is a custom warning line}}
default warning
The following is a closed discussion. Please do not modify it.

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.

custom warning
this is a custom warning line

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.

  • archiving a section
{{cot}}
==section header==
text
{{cob}}

rewritten as

{{cot|section header}}
text
{{cob}}
section header

text

General information

Redirects

See also