{{i}} Документація шаблону[перегляд] [редагувати] [історія] [очистити кеш]

Шаблон {{collapse top}} (або {{cot}}), і його парний шаблон {{collapse bottom}} (або {{cob}}), використовуються для розміщення вікон із можливістю згортання на сторінках обговорень, особливо коли вміст має складну вікі-розмітку, як таблиці. Для простого вмісту можна натомість використовувати односкладний шаблон {{collapse}}.

Цей шаблон повинен використовуватись у відповідності із настановами en:Wikipedia:Refactoring; вони ніколи не повинні використовуватися для завершення обговорення, незважаючи на заперечення інших редакторів, за винятком випадків однозначного деструктивного редагування.

Не ховайте вміст у статтях. Це порушує настанови en:WP:Manual of Style#Scrolling lists and collapsible content та en:WP:Accessibility.

Використання ред.

Розміщуєте {{collapse top}} (або {{cot}}), та {{collapse bottom}} (або {{cob}}), довкола тексту, який необхідно згорнути. Наприклад:

{{collapse top|title=Це текст заголовку}}
Текст прикладу вмісту
{{collapse bottom}}

отримаємо:

Параметри ред.

Цей шаблон приймає наступні параметри, всі з яких є необов'язковими

позиційний параметр 1, іменний параметр 'title'
Цей параметр задає головний заголовок блоку згортання, який розміщується на тому ж рядку де і посилання show та завжди є видимим. За замовчуванням має значення 'Розширюваний вміст'. Наприклад {{collapse top|Це текст заголовка}} або {{collapse top|title=Це текст заголовка}}
warning
If this parameter evaluates to true (i.e. is not empty) it will display a default warning line under the main title which reads "The following is a closed debate. Please do not modify it." For example, {{collapse top|This is the title text|warning=true}}
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. For example, {{collapse top|This is the title text|This is a custom warning line}}
left
If this parameter evaluates to true (i.e. is not empty) it will align the 'parameter 1 title' along the left margin. Text aligns centered between the left margin and the left bracket of the left show link by default. For example, {{collapse top|This is the title text|left=true}}
expand
If this parameter evaluates to true (i.e. is not empty) it will leave the material uncollapsed with the border and coloring. Default is to collapse the material. For example, {{collapse top|This is the title text|expand=true}}
bg
Sets the background color of the collapsed material. Defaults to #CFC - a pleasant green. Other colors available from List of colors. For example, {{collapse top|This is the title text|bg=#F0F2F5}}
fc
Sets the font color of the title of the collapsible bar. Defaults to Black. Other colors available from List of colors. For example, {{collapse top|This is the title text|fc=#F0F2F5}}
border
Sets the width of the border line on the collapsed material. defaults to 1px. For example, {{collapse top|This is the title text|border=2px}}
b-color
Sets the border color. defaults to silver. For example, {{collapse top|This is the title text|b-color=#F0F2F5}}
padding
Sets the padding on the collapsed material in the colored area. Defaults to 8px. For example, {{collapse top|This is the title text|padding=16px}}
width
Sets the width of the overall template. Use |width=50%, not |Width=50% as upper case "W" doesn't work. Or |width=200px (if you omit "px" it doesn't work).
border2
Sets the border of the box that appears when template is expanded; defaults to "1px silver" (there is no provision to change from a solid line). For example, {{collapse top|This is the title text|border2=2px}}
bg2
Sets background of the box that appears when template is expanded; defaults to white. For example, {{collapse top|This is the title text|bg2=#F0F2F5}}
indent
indents the box from the left of the page. Use: |indent=50px not |Indent=50px (upper case "I" doesn't work). Defaults to "do not indent" (i.e. 0px). Each ":" in wiki-markup is approximately equivalent to 25px indent.

If an entire section is being closed, remove the section header and add it as the first parameter of the template. This keeps the section header from showing in the TOC. For example, {{collapse top|Section header}}

Приклади ред.

  • Adding a box title (if omitted, default is 'Extended content') - {{collapse top|This is the title text}}
  • Adding a standard warning line - {{collapse top|This is the title text|warning=true}}
  • Adding a custom warning line - {{collapse top|This is the title text|This is a custom warning line}}
  • Aligning box title along left margin - {{collapse top|left=true}} or {{collapse top|left=true}}
  • Changing background color - {{collapse top|bg=#F0F2F5}} or {{collapse top|bg=#F0F2F5}}
  • Adding extra padding - {{collapse top|padding=40px}}
  • Archiving a section: the markup below:
{{collapse top}}
==Section header==
Sample contents text
{{collapse bottom}}

must be rewritten as:

{{collapse top|Section header}}
Sample contents text
{{collapse bottom}}

The end result:

Перенаправлення ред.

На Collapse top:

На Collapse bottom:

Див. також ред.

Шаблон:Warchivenav