+ == См. также ==
 
direct deps
Строка 1: Строка 1:
{{docpage}}
{{Documentation subpage}}
{{High-use}}
{{Template shortcuts|clist}}
{{lua|Module:Collapsible list}}
{{Collapse Templates}}


Этот шаблон предназначен для создания скрывающихся списков.
This template produces a collapsible list. It is possible to set [[CSS]] styles for the "frame" (the {{tag|div}} tags surrounding the list), for the list title, and for the list items. The template supports an unlimited number of list items.


== Примеры использования ==
This template is typically used in [[WP:Infobox|infoboxes]] and [[WP:NAVBOX|navboxes]]; it should not normally be used in regular article content, per [[MOS:DONTHIDE]].
=== В статье ===
 
{{demo|reverse=1|br=|<nowiki>
Regarding using this template in infoboxes, MOS:DONTHIDE acknowledges an exception: {{xt|A few infoboxes also use pre-collapsed sections for infrequently accessed details. If [such] information ... seems extraneous or trivial enough to inspire pre-collapsing it, consider raising a discussion on the article (or template) talk page about whether it should be [[Wikipedia:What Wikipedia is not#Wikipedia is not an indiscriminate collection of information|included at all]].}}
{{Collapsible list |title= [[Файл:commons-logo.svg|12px|Логотип Викисклада|link=Викисклад]] [[:commons:Category:Signatures of politicians from Russia|Category:Signatures of politicians from Russia]]
 
|* [[:Файл:Signature of Anatoly Chubais.png|Signature of Anatoly Chubais.png]] (17:00, 17 марта 2011)
== Syntax ==
* [[:Файл:Signature of Vladimir Zhirinovsky.png|Signature of Vladimir Zhirinovsky.png]] (17:22, 17 марта 2011)
<syntaxhighlight lang="wikitext" style="font-size:95%;overflow:auto;">
* [[:Файл:Signature of Yury Luzhkov.png|Signature of Yury Luzhkov.png]] (17:25, 17 марта 2011)
{{Collapsible list
* [[:Файл:Signature of Alexei Kudrin.png|Signature of Alexei Kudrin.png]] (10:13, 18 марта 2011)
| expand =  
* [[:Файл:Signature of German Gref.png|Signature of German Gref.png]] (10:17, 18 марта 2011)
| framestyle =  
* [[:Файл:Signature of Rashid Nurgaliyev.png|Signature of Rashid Nurgaliyev.png]] (10:25, 18 марта 2011)
| titlestyle =  
* [[:Файл:Signature of Sergey Lavrov.png|Signature of Sergey Lavrov.png]] (10:26, 18 марта 2011)
| title =  
* [[:Файл:Signature of Sergey Mironov.png|Signature of Sergey Mironov.png]] (10:32, 18 марта 2011)
| liststyle =  
* [[:Файл:Signature of Sergey Shoygu.png|Signature of Sergey Shoygu.png]] (10:35, 18 марта 2011)
| hlist =
* [[:Файл:Signature of Vitaliy Mutko.png|Signature of Vitaliy Mutko.png]] (10:36, 18 марта 2011)
| bullets =  
* [[:Файл:Signature of Vladimir Shamanov.png|Signature of Vladimir Shamanov.png]] (10:40, 18 марта 2011)
| 1 =    <!--(First item in list; the "1 =" is usually not required)-->
| 2 =    <!--(Second item in list; ditto)-->
| 3 =     <!--(Third item in list; etc.)-->
| <!-- etc. -->
}}
</syntaxhighlight>
 
== Parameters ==
{{Aligned table
|style=line-height:1.35em;
|col1style=padding-right:1.5em; |col2style=vertical-align:middle;
| ''expand''    | Any text in this parameter (including "no") sets the list's default state to expanded rather than collapsed. Omit the parameter or leave it blank to set the default state to collapsed.
| ''framestyle'' | Custom CSS styling applied the template overall (title and list).
| ''titlestyle'' | Custom CSS styling applied to the title.
| ''title''      | The list's title (always on view beside the list's [show/hide] link).
| ''liststyle''  | Custom CSS styling applied to the list (specifically, to the {{tag|ul}} tags delimiting the list).
| ''hlist''      | Include as {{para|hlist|on}}, {{para|hlist|true}}, etc. to produce a horizontal rather than vertical list.
| ''bullets''    | Include as {{para|bullets|on}}, {{para|bullets|true}}, etc. to place a [[Bullet (typography)|bullet point]] before each list item.
| Unnamed parameters<br>(first, second, third...) | The list items (in the order in which they will appear). If none are supplied, the template outputs nothing.
}}
 
== Examples ==
<syntaxhighlight lang="wikitext" style="font-size:95%;overflow:auto;">
{{Collapsible list
| title = [[European Free Trade Association]] members
| [[Iceland]]
| [[Liechtenstein]]
| [[Norway]]
| [[Switzerland]]
}}
}}
</nowiki>}}
</syntaxhighlight>
=== В карточке ===
{{collapsible list |title=[[European Free Trade Association]] members |[[Iceland]] |[[Liechtenstein]] |[[Norway]] |[[Switzerland]]}}
{{Организация
 
|название      = Лига арабских государств
=== Example of a list without borders because it is within an infobox ===
|альтернативное = {{lang-ar|جامعة الدول العربية}}
In these examples, the fields leader_name2 and leader_name3 have been changed to use collapsible list.
|членство      = {{Collapsible list |title=22 + 4 |
{{Infobox settlement
; Члены
|official_name    = City of Hamilton
: {{флагификация|Алжир}}
|motto            = Together Aspire – Together Achieve
: {{флагификация|Бахрейн}}
|image_skyline    = HamiltonOntarioSkylineC.JPG
: {{флагификация|Джибути}}
|imagesize        = 250px
: {{флагификация|Египет}}
|image_caption    = <!--
: {{флагификация|Иордания}}
|image_map        = Map of Ontario HAMILTON.svg
: {{флагификация|Ирак}}
|mapsize          = 200px
: {{флагификация|Йемен}}
|map_caption      = Location in the province of Ontario, Canada-->
: {{флагификация|Катар}}
|subdivision_type  = Country
: {{флагификация|Коморы}}
|subdivision_name  = Canada
: {{флагификация|Кувейт}}
|subdivision_type1 = [[Provinces and territories of Canada|Province]]
: {{флагификация|Ливан}}
|subdivision_name1 = [[Ontario]]
: {{Флагификация|Ливия}}
|leader_title      = [[Mayor]]
: {{флагификация|Мавритания}}
|leader_name      = [[Fred Eisenberger]]
: {{флагификация|Марокко}}
|leader_title1    = [[City council]]
: {{флагификация|ОАЭ}}
|leader_name1      = [[Hamilton, Ontario, City Council]]
: {{флагификация|Оман}}
|leader_title2    = [[Member of Parliament (Canada)|MPs]]
: {{флагификация|Государство Палестина}}
|leader_name2      =
: {{флагификация|Саудовская Аравия}}
{{Collapsible list
: {{флагификация|Сирия}}
  |framestyle=border:none; padding:0; <!--Hides borders and improves row spacing-->
: {{флагификация|Сомали}}
  |title=List of MPs
: {{флагификация|Судан}}
  |1=[[Dean Allison]] |2=[[Chris Charlton]] |3=[[David Christopherson]] |4=[[Wayne Marston]] |5=[[David Sweet]]
: {{флагификация|Тунис}}
}}
; Наблюдатели
|leader_title3    = [[Member of Provincial Parliament (Ontario)|MPPs]]
: {{флагификация|Бразилия}}
|leader_name3      =
: {{флагификация|Венесуэла}}
{{Collapsible list
: {{флагификация|Индия}}
  |framestyle=border:none; padding:0; <!--as above-->
: {{флагификация|Эритрея}}
  |title=List of MPPs
  }}
  |1=[[Marie Bountrogianni]] |2=[[Andrea Horwath]] |3=[[Judy Marsales]] |4=[[Ted McMeekin]] |5=[[Jennifer Mossop]]
|тип            = Международная организация
}}
|established_title = [[Municipal corporation|Incorporated]]
|established_date  = June 9, 1846
|short_description =  
}}
}}
<pre>{{Организация
<syntaxhighlight lang="wikitext" style="font-size:95%; overflow:auto;">
|название      = Лига арабских государств
{{Infobox settlement
|альтернативное = {{lang-ar|جامعة الدول العربية}}
|official_name    = City of Hamilton
|членство       = {{Collapsible list |title=22 + 4|
...truncated...
; Члены
|leader_title      = [[Mayor]]
: {{флагификация|Алжир}}
|leader_name       = [[Fred Eisenberger]]
: {{флагификация|Бахрейн}}
|leader_title1    = [[City council]]
: {{флагификация|Джибути}}
|leader_name1      = [[Hamilton City Council]]
: {{флагификация|Египет}}
|leader_title2    = [[Member of Parliament (Canada)|MPs]]
: {{флагификация|Иордания}}
|leader_name2      =
: {{флагификация|Ирак}}
{{Collapsible list
: {{флагификация|Йемен}}
  |framestyle=border:none; padding:0; <!--Hides borders and improves row spacing-->
: {{флагификация|Катар}}
  |title=List of MPs
: {{флагификация|Коморы}}
  |1=[[Dean Allison]] |2=[[Chris Charlton]] |3=[[David Christopherson]] |4=[[Wayne Marston]] |5=[[David Sweet]]
: {{флагификация|Кувейт}}
}}
: {{флагификация|Ливан}}
|leader_title3    = [[Member of Provincial Parliament (Ontario)|MPPs]]
: {{Флагификация|Ливия}}
|leader_name3      =
: {{флагификация|Мавритания}}
{{Collapsible list
: {{флагификация|Марокко}}
  |framestyle=border:none; padding:0; <!--as above-->
: {{флагификация|ОАЭ}}
  |title=List of MPPs
: {{флагификация|Оман}}
  |1=[[Marie Bountrogianni]] |2=[[Andrea Horwath]] |3=[[Judy Marsales]] |4=[[Ted McMeekin]] |5=[[Jennifer Mossop]]
: {{флагификация|Государство Палестина}}
}}
: {{флагификация|Саудовская Аравия}}
|established_title = [[Municipal corporation|Incorporated]]
: {{флагификация|Сирия}}
|established_date  = June 9, 1846
: {{флагификация|Сомали}}
(...etc....)
: {{флагификация|Судан}}
: {{флагификация|Тунис}}
; Наблюдатели
: {{флагификация|Бразилия}}
: {{флагификация|Венесуэла}}
: {{флагификация|Индия}}
: {{флагификация|Эритрея}}
  }}
|тип            = Международная организация
}}
}}
</pre>
</syntaxhighlight>
 
== TemplateData ==
{{TemplateDataHeader}}
<templatedata>
{
"params": {
"1": {
"label": "First list item",
"description": "A single list item",
"type": "content",
"suggested": true
},
"2": {
"label": "Second list item",
"description": "A single list item",
"type": "content",
"suggested": true
},
"3": {
"label": "Third list item",
"description": "A single list item",
"type": "content",
"suggested": true
},
"4": {
"label": "Fourth list item",
"description": "A single list item",
"type": "content"
},
"5": {
"label": "Fifth list item",
"description": "A single list item",
"type": "content"
},
"6": {
"label": "Sixth list item",
"type": "content",
"description": "A single list item"
},
"7": {
"type": "content",
"label": "Seventh list item",
"description": "A single list item"
},
"8": {
"type": "content",
"label": "Eighth list item",
"description": "A single list item"
},
"9": {
"type": "content",
"label": "Ninth list item",
"description": "A single list item"
},
"10": {
"type": "content",
"label": "Tenth list item",
"description": "A single list item"
},
"expand": {
"label": "Expand list",
"description": "Expand the list instead of collapsing it",
"example": "true",
"type": "string",
"autovalue": "true",
"suggestedvalues": [
"true"
]
},
"framestyle": {
"aliases": [
"frame_style"
],
"label": "Frame style",
"description": "Custom CSS styling applied the template overall (title and list).",
"example": "border: 1px solid grey;",
"type": "string"
},
"titlestyle": {
"aliases": [
"title_style"
],
"label": "Title style",
"description": "CSS styling applied to the title",
"example": "color:brown;",
"type": "string"
},
"title": {
"label": "Title",
"description": "The list's title (Always in view beside the list's [show/hide] link).",
"type": "string",
"suggested": true
},
"liststyle": {
"aliases": [
"list_style"
],
"label": "List style",
"description": "CSS styling applied solely to the list itself",
"example": "list-style-type: square;",
"type": "string"
},
"hlist": {
"label": "Horizontal list",
"description": "Use value 'on' or 'true' to produce a horizontal rather than vertical list",
"example": "true",
"type": "string",
"autovalue": "true",
"suggestedvalues": [
"on",
"true"
]
},
"bullets": {
"label": "Bullets",
"description": "Set as 'on' or 'true' to place a bullet point before each list item",
"example": "true",
"type": "string",
"autovalue": "true"
}
},
"description": "Produces an HTML list that can be collapsed",
"paramOrder": [
"title",
"hlist",
"bullets",
"expand",
"1",
"framestyle",
"titlestyle",
"liststyle",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10"
],
"format": "block"
}
</templatedata>


== См. также ==
<includeonly>{{Sandbox other||
* {{tl|Начало скрытого блока}} / {{tl|Конец скрытого блока}}
[[Category:Collapse templates]]
* {{t|Скрытый блок}}
[[Category:List formatting and function templates]]
* [[Википедия:Сворачиваемые блоки]]


<includeonly>
}}</includeonly>
[[Категория:Шаблоны:Сворачиваемые блоки]]
[[Категория:Шаблоны:Для шаблонов-карточек]]
[[Категория:Шаблоны:Списки]]
</includeonly>

Версия от 23:46, 7 апреля 2026

This template produces a collapsible list. It is possible to set CSS styles for the "frame" (the <div>...</div> tags surrounding the list), for the list title, and for the list items. The template supports an unlimited number of list items.

This template is typically used in infoboxes and navboxes; it should not normally be used in regular article content, per MOS:DONTHIDE.

Regarding using this template in infoboxes, MOS:DONTHIDE acknowledges an exception: A few infoboxes also use pre-collapsed sections for infrequently accessed details. If [such] information ... seems extraneous or trivial enough to inspire pre-collapsing it, consider raising a discussion on the article (or template) talk page about whether it should be included at all.

Syntax

{{Collapsible list
 | expand = 
 | framestyle = 
 | titlestyle = 
 | title = 
 | liststyle = 
 | hlist = 
 | bullets = 
 | 1 =     <!--(First item in list; the "1 =" is usually not required)-->
 | 2 =     <!--(Second item in list; ditto)-->
 | 3 =     <!--(Third item in list; etc.)-->
 | <!-- etc. -->
}}

Parameters

expand Any text in this parameter (including "no") sets the list's default state to expanded rather than collapsed. Omit the parameter or leave it blank to set the default state to collapsed.
framestyle Custom CSS styling applied the template overall (title and list).
titlestyle Custom CSS styling applied to the title.
title The list's title (always on view beside the list's [show/hide] link).
liststyle Custom CSS styling applied to the list (specifically, to the <ul>...</ul> tags delimiting the list).
hlist Include as |hlist = on, |hlist = true, etc. to produce a horizontal rather than vertical list.
bullets Include as |bullets = on, |bullets = true, etc. to place a bullet point before each list item.
Unnamed parameters
(first, second, third...)
The list items (in the order in which they will appear). If none are supplied, the template outputs nothing.

Examples

{{Collapsible list
 | title = [[European Free Trade Association]] members
 | [[Iceland]]
 | [[Liechtenstein]]
 | [[Norway]]
 | [[Switzerland]]
}}

Example of a list without borders because it is within an infobox

In these examples, the fields leader_name2 and leader_name3 have been changed to use collapsible list. {{#invoke:Infobox|infobox}}

{{Infobox settlement
|official_name     = City of Hamilton
 ...truncated...
|leader_title      = [[Mayor]]
|leader_name       = [[Fred Eisenberger]]
|leader_title1     = [[City council]]
|leader_name1      = [[Hamilton City Council]]
|leader_title2     = [[Member of Parliament (Canada)|MPs]]
|leader_name2      =
 {{Collapsible list
  |framestyle=border:none; padding:0; <!--Hides borders and improves row spacing-->
  |title=List of MPs
  |1=[[Dean Allison]] |2=[[Chris Charlton]] |3=[[David Christopherson]] |4=[[Wayne Marston]] |5=[[David Sweet]]
 }}
|leader_title3     = [[Member of Provincial Parliament (Ontario)|MPPs]]
|leader_name3      =
 {{Collapsible list
  |framestyle=border:none; padding:0; <!--as above-->
  |title=List of MPPs
  |1=[[Marie Bountrogianni]] |2=[[Andrea Horwath]] |3=[[Judy Marsales]] |4=[[Ted McMeekin]] |5=[[Jennifer Mossop]]
 }}
|established_title = [[Municipal corporation|Incorporated]]
|established_date  = June 9, 1846
 (...etc....)
}}

TemplateData

Здесь приведена документация в формате TemplateData для данного шаблона, которая используется в визуальном редакторе и прочих инструментах.

Документация TemplateData для шаблона: Collapsible list/doc

Produces an HTML list that can be collapsed

Параметры шаблона

Шаблон использует блочное форматирование параметров.

ПараметрОписаниеТипСтатус
Titletitle

The list's title (Always in view beside the list's [show/hide] link).

Строковый (без форматирования)предложенный
Horizontal listhlist

Use value 'on' or 'true' to produce a horizontal rather than vertical list

Предлагаемые значения
on true
Пример
true
Автозначение
true
Строковый (без форматирования)необязательный
Bulletsbullets

Set as 'on' or 'true' to place a bullet point before each list item

Пример
true
Автозначение
true
Строковый (без форматирования)необязательный
Expand listexpand

Expand the list instead of collapsing it

Предлагаемые значения
true
Пример
true
Автозначение
true
Строковый (без форматирования)необязательный
First list item1

A single list item

Содержимое (контент)предложенный
Frame styleframestyle frame_style

Custom CSS styling applied the template overall (title and list).

Пример
border: 1px solid grey;
Строковый (без форматирования)необязательный
Title styletitlestyle title_style

CSS styling applied to the title

Пример
color:brown;
Строковый (без форматирования)необязательный
List styleliststyle list_style

CSS styling applied solely to the list itself

Пример
list-style-type: square;
Строковый (без форматирования)необязательный
Second list item2

A single list item

Содержимое (контент)предложенный
Third list item3

A single list item

Содержимое (контент)предложенный
Fourth list item4

A single list item

Содержимое (контент)необязательный
Fifth list item5

A single list item

Содержимое (контент)необязательный
Sixth list item6

A single list item

Содержимое (контент)необязательный
Seventh list item7

A single list item

Содержимое (контент)необязательный
Eighth list item8

A single list item

Содержимое (контент)необязательный
Ninth list item9

A single list item

Содержимое (контент)необязательный
Tenth list item10

A single list item

Содержимое (контент)необязательный