Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Collapse top/doc: Difference between revisions

Template page
m linkfix
fixing problematic template use with duplicate argument
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{TemplateBox
{{TemplateBox
  |1        = 1
  |1        = 1
  |1d-en    = These parameters give the main title of collapsed box, which  
  |1d-en    = These parameters give the main title of collapsed box, which occurs on the same line as the ''show'' link and is always visible.
occurs on the same line as the ''show'' link and is always visible.
|1d-de    = Diese Parameter geben den Haupttitel der zusammengeklappten Box an, der in der gleichen Zeile wie der Link „zeigen“ steht und immer sichtbar ist.
  |1label  = header
  |1label  = header
|1label-de= Kopfzeile
  |1aliases = title / reason / header / heading
  |1aliases = title / reason / header / heading
  |1type    = string
  |1type    = string
  |1def    = Extended content
  |1def    =  
  |1stat    = optional-
  |1stat    = optional-


  |2        = warning
  |2        = warning
  |2d-en    = 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>' (except if parameter #2 is given).
  |2d-en    = 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>(except if parameter #2 is given).
   |2d-td-en = 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.', where the second sentence is in bold and red (except if parameter #2 is given).
   |2d-td-en = 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., where the second sentence is in bold and red (except if parameter #2 is given).
|2d-de    = Wenn dieser Parameter den Wert true hat (d.h. nicht 0, false oder leer ist), wird unter dem Haupttitel eine Standard-Warnzeile angezeigt, die lautet: "Das Folgende ist eine archivierte Debatte. <span style="color:red;">'''Bitte nicht verändern.'''</span>" (außer wenn Parameter #2 angegeben wird).
  |2d-td-de = Wenn dieser Parameter den Wert true hat (d.h. nicht 0, false oder leer ist), wird unter dem Haupttitel eine Standard-Warnzeile angezeigt, die lautet: "Das Folgende ist eine archivierte Debatte. Bitte ändere sie nicht.", wobei der zweite Satz fett und rot ist (außer wenn der Parameter #2 angegeben wird).
  |2label  = show warning text
  |2label  = show warning text
  |2type    = unknown
|2label-de= Warntext anzeigen
  |2type    = line
  |2def    = <!-- default value for the parameter -->
  |2def    = <!-- default value for the parameter -->
  |2stat    = optional-
  |2stat    = optional-
Line 19: Line 23:
  |3        = 2
  |3        = 2
  |3d-en    = This is optional warning-line text.  It will override the standard warning line above, and obviate the need for setting the 'warning' parameter.
  |3d-en    = This is optional warning-line text.  It will override the standard warning line above, and obviate the need for setting the 'warning' parameter.
|3d-de    = Dies ist ein optionaler Warnzeilentext.  Er überschreibt die obige Standardwarnzeile und macht das Setzen des Parameters „warning“ überflüssig.
  |3label  = custom warning text
  |3label  = custom warning text
  |3type    = string/line
|3label-de= Benutzerdefinierter Warntext
  |3type    = string
  |3def    = <!-- default value for the parameter -->
  |3def    = <!-- default value for the parameter -->
  |3stat    = optional-
  |3stat    = optional-
Line 26: Line 32:
  |4        = expand
  |4        = expand
  |4d-en    = 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.  However, when previewing edits, content will always display as uncollapsed; this is often helpful, but also often confusing!
  |4d-en    = 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.  However, when previewing edits, content will always display as uncollapsed; this is often helpful, but also often confusing!
|4d-de    = Wenn dieser Parameter den Wert true hat (d.h. nicht 0, false oder leer ist), wird das Material mit dem Rand und der Färbung nicht eingeklappt. Standardmäßig wird das Material eingeklappt.  In der Bearbeitungsvorschau wird der Inhalt jedoch immer als nicht eingeklappt angezeigt; das ist oft hilfreich, aber auch oft verwirrend!
  |4label  = expand
  |4label  = expand
  |4type    = unknown
|4label-de= erweitern
  |4def    = <!-- default value for the parameter -->
  |4type    = line
  |4sv      = /true
  |4stat    = optional-
  |4stat    = optional-


  |5        = bg
  |5        = bg
  |5d-en    = Sets the background color of the collapsed material
  |5d-en    = Sets the background color of the collapsed material
  |5label  = background
|5d-de    = Legt die Hintergrundfarbe des eingeklappten Materials fest
  |5label  = background color
|5label-de  = Hintergrundfarbe
  |5type    = string
  |5type    = string
  |5def    = #CFC - a pleasant green
  |5def    = #CFC
  |5stat    = optional-
  |5stat    = optional-


  |6        = border
  |6        = border
  |6d-en    = Sets the width of the border line on the collapsed material.
  |6d-en    = Sets the width of the border line on the collapsed material. (in px)
|6d-de    = Legt die Breite der Umrandungslinie auf dem eingeklappten Material fest. (in px)
  |6label  = border width
  |6label  = border width
|6label-de  = Rahmenbreite
  |6type    = number
  |6type    = number
  |6def    = 1px
  |6def    = 1
  |6stat    = optional-
  |6stat    = optional-


  |7        = b-color
  |7        = b-color
  |7d-en    = Sets the border color.
  |7d-en    = Sets the border color.
|7d-de    = Legt die Farbe des Rahmens fest.
  |7label  = border color
  |7label  = border color
|7label-de= Rahmenfarbe
  |7type    = string
  |7type    = string
  |7def    = silver
  |7def    = silver
Line 53: Line 67:


  |8        = padding
  |8        = padding
  |8d-en    = Sets the padding on the collapsed material in the colored area.
  |8d-en    = Sets the padding on the collapsed material in the colored area. (in px)
|8d-de    = Legt das Padding des eingeklappten Materials im farbigen Bereich fest. (in px)
  |8label  = padding
  |8label  = padding
|8label-de= Padding
  |8type    = number
  |8type    = number
  |8def    = 8px
  |8def    = 8
  |8stat    = optional-
  |8stat    = optional-


  |9        = width
  |9        = width
  |9d-en    = Sets the width of the overall template
  |9d-en    = Sets the width of the overall template (in px)
|9d-de    = Legt die Breite der gesamten Vorlage fest (in px)
  |9label  = box width
  |9label  = box width
|9label-de= Kastenbreite
  |9type    = number
  |9type    = number
  |9def    = <!-- default value for the parameter -->
  |9def    = <!-- default value for the parameter -->
Line 69: Line 87:
  |desc = {{redirects|cot|cob}}The collapse template is used for placing collapse boxes around discussions.
  |desc = {{redirects|cot|cob}}The collapse template is used for placing collapse boxes around discussions.
   |desc-td = The collapse template is used for placing collapse boxes around discussions.
   |desc-td = The collapse template is used for placing collapse boxes around discussions.
|desc-de = {{redirects|cot|cob}}Die Klappvorlage wird verwendet, um einklappbare Boxen um Diskussionen herum zu platzieren.
  |desc-td-de = Die Klappvorlage wird verwendet, um einklappbare Boxen um Diskussionen herum zu platzieren.
  |namespace = talks
  |namespace = talks
  |usergroup =  
  |usergroup = all
  |placement =  
  |placement =  
  |usage-notes = Place {{tl|collapse top}} and {{tl|collapse bottom}} around the text to be collapsed. If an entire section is being archived, [[#Archiving a section|remove the section header and add it as the first parameter of the template]]. This keeps the section header from showing in the TOC.
  |usage-notes = {{LangSwitch
|en=Place {{tl|collapse top}} and {{tl|collapse bottom}} around the text to be collapsed. If an entire section is being archived, [[#Archiving a section|remove the section header and add it as the first parameter of the template]]. This keeps the section header from showing in the TOC.
|de=Platziere {{tl|collapse top}} und {{tl|collapse bottom}} um den Text, der eingeklappt werden soll. Wenn ein ganzer Abschnitt archiviert wird, [[#Archiving a section|entferne die Abschnittsüberschrift und füge sie als ersten Parameter der Vorlage hinzu]]. So wird die Abschnittsüberschrift nicht im Inhaltsverzeichnis angezeigt.
}}
  |type =  
  |type =  
  |example =  
  |example =  
  |example-value =  
  |example-value =  
  |i18n-method = -
  |i18n-method = ext.translate
  |i18n-desc =  
  |i18n-desc =  
  |i18n-mediawiki-msg =  
  |i18n-mediawiki-msg =  
  |i18n-subpage =  
  |i18n-subpage = i18n
  |seealso = * {{Tl|collapse}}
  |seealso = * {{Tl|collapse}}
* {{Tl|collapse top}}, {{Tl|collapse bottom}}
* {{Tl|collapse top}}{{,}}{{Tl|collapse bottom}}
* {{tl|discussion top}}
* {{tl|discussion top}}
  |setscats =  
  |setscats =  
Line 93: Line 116:
== Examples ==
== Examples ==
=== Simple ===
=== Simple ===
<pre>{{Collapse top|This is the title text}}
<syntaxhighlight lang="wikitext">{{Collapse top|This is the title text}}
{{lorem ipsum}}
{{lorem ipsum}}
{{Collapse bottom}}</pre>
{{Collapse bottom}}</syntaxhighlight>
{{Collapse top|This is the title text}}
{{Collapse top|This is the title text}}
{{lorem ipsum}}
{{lorem ipsum}}
{{Collapse bottom}}
{{Collapse bottom}}
=== Changing background color ===
=== Changing background color ===
<pre>{{Collapse top|bg=#F0F2F5}} or {{cot|bg=#F0F2F5}}</pre>
<syntaxhighlight lang="wikitext">{{Collapse top|bg=#F0F2F5}} or {{cot|bg=#F0F2F5}}</syntaxhighlight>
{{cot|bg=#F0F2F5}}
{{cot|bg=#F0F2F5}}
{{lorem ipsum}}
{{lorem ipsum}}
{{cob}}
{{cob}}
=== Changing border color ===
=== Changing border color ===
<pre>{{cot|b-color=#ff0000}}</pre>
<syntaxhighlight lang="wikitext">{{cot|b-color=#ff0000}}</syntaxhighlight>
{{cot|b-color=#ff0000}}
{{cot|b-color=#ff0000}}
{{lorem ipsum}}
{{lorem ipsum}}
{{cob}}
{{cob}}
=== Adding extra padding ===
=== Adding extra padding ===
<pre>{{cot|padding=40px}}</pre>
<syntaxhighlight lang="wikitext">{{cot|padding=40px}}</syntaxhighlight>
{{cot|padding=40px}}
{{cot|padding=40px}}
{{lorem ipsum}}
{{lorem ipsum}}
{{cob}}
{{cob}}
=== Adding a warning line ===
=== Adding a warning line ===
<pre>{{cot|default warning|warning=1}}</pre>
<syntaxhighlight lang="wikitext">{{cot|default warning|warning=1}}</syntaxhighlight>
{{cot|default warning|warning=1}}
{{cot|default warning|warning=1}}
{{lorem ipsum}}
{{lorem ipsum}}
{{cob}}
{{cob}}
<pre>{{cot|custom warning|this is a custom warning line}}</pre>
<syntaxhighlight lang="wikitext">{{cot|custom warning|this is a custom warning line}}</syntaxhighlight>
{{cot|custom warning|this is a custom warning line}}
{{cot|custom warning|this is a custom warning line}}
{{lorem ipsum}}
{{lorem ipsum}}
{{cob}}
{{cob}}
=== Archiving a section ===
=== Archiving a section ===
<pre>{{cot}}
<syntaxhighlight lang="wikitext">{{cot}}
==section header==
==section header==
text
text
{{cob}}</pre>
{{cob}}</syntaxhighlight>
rewritten as
rewritten as
<pre>{{cot|section header}}
<syntaxhighlight lang="wikitext">{{cot|section header}}
text
text
{{cob}}</pre>
{{cob}}</syntaxhighlight>
{{cot|section header}}
{{cot|section header}}
text
text

Latest revision as of 08:46, 29 December 2025

The collapse template is used for placing collapse boxes around discussions.

Usage

{{Collapse top}}

Place {{Collapse top}} and {{Collapse bottom}} around the text to be collapsed. 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.

Template parameters

ParameterDescriptionDefaultStatus
1
title
reason
header
heading
headerThese parameters give the main title of collapsed box, which occurs on the same line as the show link and is always visible.emptyoptional
warningshow warning textIf 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.” (except if parameter #2 is given).emptyoptional
2custom warning textThis is optional warning-line text. It will override the standard warning line above, and obviate the need for setting the 'warning' parameter.emptyoptional
expandexpandIf 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. However, when previewing edits, content will always display as uncollapsed; this is often helpful, but also often confusing!emptyoptional
bgbackground colorSets the background color of the collapsed material#CFCoptional
borderborder widthSets the width of the border line on the collapsed material. (in px)1optional
b-colorborder colorSets the border color.silveroptional
paddingpaddingSets the padding on the collapsed material in the colored area. (in px)8optional
widthbox widthSets the width of the overall template (in px)emptyoptional
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.


Wikipedia's help about TemplateDataCommons-specific information

The collapse template is used for placing collapse boxes around discussions.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
header1 title reason header heading

These parameters give the main title of collapsed box, which occurs on the same line as the ''show'' link and is always visible.

Stringoptional
custom warning text2

This is optional warning-line text. It will override the standard warning line above, and obviate the need for setting the 'warning' parameter.

Stringoptional
border colorb-color

Sets the border color.

Default
silver
Stringoptional
background colorbg

Sets the background color of the collapsed material

Default
#CFC
Stringoptional
border widthborder

Sets the width of the border line on the collapsed material. (in px)

Default
1
Numberoptional
expandexpand

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. However, when previewing edits, content will always display as uncollapsed; this is often helpful, but also often confusing!

Suggested values
true
Lineoptional
paddingpadding

Sets the padding on the collapsed material in the colored area. (in px)

Default
8
Numberoptional
show warning textwarning

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.”, where the second sentence is in bold and red (except if parameter #2 is given).

Lineoptional
box widthwidth

Sets the width of the overall template (in px)

Numberoptional

Additional information

The template is intended to be used in the following namespaces: all talk namespaces and noticeboards

The template is intended to be used by the following user groups: all users

See also

Localization

العربية  Deutsch  English  français  हिन्दी  македонски  Nederlands

This template makes use of {{Autotranslate}} and the translate extension.


Examples

Simple

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

Lorem ipsum dolor sit amet, consectetur adipisicing 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.

Changing background color

{{Collapse top|bg=#F0F2F5}} or {{cot|bg=#F0F2F5}}
Extended content

Lorem ipsum dolor sit amet, consectetur adipisicing 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.

Changing border color

{{cot|b-color=#ff0000}}
Extended content

Lorem ipsum dolor sit amet, consectetur adipisicing 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 adipisicing 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}}
default warning
The following is a closed debate. Please do not modify it.

Lorem ipsum dolor sit amet, consectetur adipisicing 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.

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

Lorem ipsum dolor sit amet, consectetur adipisicing 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

Cookies help us deliver our services. By using our services, you agree to our use of cookies.