en>WOSlinker (text) |
en>ENeRZet (text editing) |
||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> | <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> | ||
{{ | {{Uses TemplateStyles|Template:Flatlist/styles.css}} | ||
This template provides a WCAG/ISO-standards-compliant accessible alternative to comma or dash (or other single character) separated lists. | |||
This template provides a | |||
== Usage == | == Usage == | ||
{{ | {{Tlx|flatlist}} starts a horizontal list, such as: | ||
{{flatlist| | {{flatlist| | ||
* | * cat | ||
* | * dog | ||
* | * horse | ||
* | * cow | ||
* | * sheep | ||
* | * pig | ||
}} | }} | ||
== Parameters == | == Parameters == | ||
{{ | {{TemplateData header}} | ||
<templatedata> | |||
{ | { | ||
"description": { | "description": { | ||
"en": "Used to create plain (i.e. unbulleted) lists." | "en": "Used to create plain (i.e. unbulleted) lists.", | ||
"cs": "Používá se k vytváření jednoduchých (tj. bez odrážek) seznamů." | |||
}, | }, | ||
"format": "inline", | "format": "inline", | ||
| Line 32: | Line 28: | ||
"1": { | "1": { | ||
"label": { | "label": { | ||
"en": "Content" | "en": "Content", | ||
"cs": "Obsah" | |||
}, | }, | ||
"description": { | "description": { | ||
"en": "The list to wrap." | "en": "The list to wrap.", | ||
"cs": "Seznam k zabalení." | |||
}, | }, | ||
"suggested": true, | "suggested": true, | ||
| Line 42: | Line 40: | ||
"class": { | "class": { | ||
"label": { | "label": { | ||
"en": "Extra Classes" | "en": "Extra Classes", | ||
"cs": "Extra třídy" | |||
}, | }, | ||
"description": { | "description": { | ||
"en": "Adds extra CSS classes to the containing div." | "en": "Adds extra CSS classes to the containing div.", | ||
"cs": "Přidá další třídy CSS do obsahující div." | |||
}, | }, | ||
"type": "string" | "type": "string" | ||
| Line 51: | Line 51: | ||
"style": { | "style": { | ||
"label": { | "label": { | ||
"en": "CSS Style" | "en": "CSS Style", | ||
"cs": "Styl CSS" | |||
}, | }, | ||
"description": { | "description": { | ||
"en": "Adds extra CSS properties to the containing div. | "en": "Adds extra CSS properties to the containing div.", | ||
"cs": "Přidá další vlastnosti CSS do obsahující div." | |||
}, | }, | ||
"example": "\n border: solid 1px silver;\n background: lightyellow;\n", | "example": "\n border: solid 1px silver;\n background: lightyellow;\n", | ||
| Line 61: | Line 63: | ||
"indent": { | "indent": { | ||
"label": { | "label": { | ||
"en": "Indent" | "en": "Indent", | ||
"cs": "Odrážka" | |||
}, | }, | ||
"description": { | "description": { | ||
"en": "Indents the list by a number of standard indents (one indent being 1. | "en": "Indents the list by a number of standard indents (one indent being 1.6em), particularly handy for inclusion in an indented discussion thread.", | ||
"cs": "Odsadí seznam o několik standardních odsazení (jedna odrážka je 1,6 em), což je zvláště užitečné pro zahrnutí do odsazeného diskusního vlákna." | |||
}, | }, | ||
"example": "2", | "example": "2", | ||
| Line 77: | Line 81: | ||
] | ] | ||
} | } | ||
</templatedata> | </templatedata> | ||
== Examples == | == Examples == | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="moin"> | ||
{{flatlist| | {{flatlist| | ||
* | * cat | ||
* | * dog | ||
* | * horse | ||
* | * cow | ||
* | * sheep | ||
* | * pig | ||
}} | }} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 104: | Line 98: | ||
{{flatlist| | {{flatlist| | ||
* | * cat | ||
* | * dog | ||
* | * horse | ||
* | * cow | ||
* | * sheep | ||
* | * pig | ||
}} | }} | ||
=== Syntax for ordered lists === | === Syntax for ordered lists === | ||
< | <pre> | ||
{{flatlist| | {{flatlist| | ||
# | # first | ||
# | # second | ||
# | # third | ||
# | # fourth | ||
# | # fifth | ||
# | # sixth | ||
}} | }} | ||
</ | </pre> | ||
produces: | produces: | ||
{{flatlist| | {{flatlist| | ||
# | # first | ||
# | # second | ||
# | # third | ||
# | # fourth | ||
# | # fifth | ||
# | # sixth | ||
}} | }} | ||
=== Using optional parameters === | === Using optional parameters === | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="moin"> | ||
{{flatlist |indent=2 | {{flatlist |indent=2 | ||
|style=border:solid 1px silver; background:lightyellow; | |style=border:solid 1px silver; background:lightyellow; | ||
|class=nowraplinks | | |class=nowraplinks | | ||
* | * Alpine skiing at the 1936 Winter Olympics | ||
* | * Alpine skiing at the 1948 Winter Olympics | ||
* | * Alpine skiing at the 1952 Winter Olympics | ||
* | * Alpine skiing at the 1956 Winter Olympics | ||
* | * Alpine skiing at the 1960 Winter Olympics | ||
* | * Alpine skiing at the 1964 Winter Olympics | ||
}} | }} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 175: | Line 146: | ||
{{flatlist |indent=2 |style=border:solid 1px silver; background:lightyellow; |class=nowraplinks | | {{flatlist |indent=2 |style=border:solid 1px silver; background:lightyellow; |class=nowraplinks | | ||
* | * Alpine skiing at the 1936 Winter Olympics | ||
* | * Alpine skiing at the 1948 Winter Olympics | ||
* | * Alpine skiing at the 1952 Winter Olympics | ||
* | * Alpine skiing at the 1956 Winter Olympics | ||
* | * Alpine skiing at the 1960 Winter Olympics | ||
* | * Alpine skiing at the 1964 Winter Olympics | ||
}} | }} | ||
== Technical details == | == Technical details == | ||
This template uses the <code>.hlist</code> [[Cascading Style Sheets|CSS]] class defined in | This template uses the <code>.hlist</code> [[w:Cascading Style Sheets|CSS]] class defined in the TemplateStyles to generate horizontal lists. It causes ordinary HTML list items to be displayed inline (horizontally), where they would normally display as block elements (vertically). The class also generates the interpuncts between list items and parentheses around nested lists. | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 201: | Line 172: | ||
}} | }} | ||
</pre> | </pre> | ||
| {{ | | {{#tag:pre| | ||
{{flatlist| | {{flatlist| | ||
* cat | * cat | ||
| Line 224: | Line 195: | ||
== See also == | == See also == | ||
* {{ | * {{tlx|multi-column numbered list}} | ||
* {{tlx|nowrap}} | |||
* {{tlx|pagelist}} | |||
* {{ | * {{tlx|Hlist}} – Uses [[Module:List]] | ||
* {{ | * {{ll|Help:Lists}} | ||
* {{ | |||
* {{ | {{navbox lists}} | ||
{{ | |||
<includeonly>{{Sandbox other|| | <includeonly>{{Sandbox other|| | ||
<!-- Categories below this line; interwikis at Wikidata --> | <!-- Categories below this line; interwikis at Wikidata --> | ||
[[Category:Typing-aid templates | [[Category:Typing-aid templates{{#translation:}}]] | ||
[[Category: | [[Category:Formatting templates{{#translation:}}]] | ||
}}</includeonly> | }}</includeonly> | ||
Revision as of 08:17, 23 October 2022
| This is a documentation subpage for Template:Flatlist. It may contain usage information, categories and other content that is not part of the original template page. |
Lua error: callParserFunction: function "#translation" was not found. This template provides a WCAG/ISO-standards-compliant accessible alternative to comma or dash (or other single character) separated lists.
Usage
{{flatlist}} starts a horizontal list, such as:
- cat
- dog
- horse
- cow
- sheep
- pig
Parameters
TemplateData for Flatlist
Used to create plain (i.e. unbulleted) lists.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Extra Classes | class | Adds extra CSS classes to the containing div. | String | optional |
| CSS Style | style | Adds extra CSS properties to the containing div.
| String | optional |
| Indent | indent | Indents the list by a number of standard indents (one indent being 1.6em), particularly handy for inclusion in an indented discussion thread.
| Number | optional |
| Content | 1 | The list to wrap. | Content | suggested |
Examples
{{flatlist|
* cat
* dog
* horse
* cow
* sheep
* pig
}}produces:
- cat
- dog
- horse
- cow
- sheep
- pig
Syntax for ordered lists
{{flatlist|
# first
# second
# third
# fourth
# fifth
# sixth
}}
produces:
- first
- second
- third
- fourth
- fifth
- sixth
Using optional parameters
{{flatlist |indent=2
|style=border:solid 1px silver; background:lightyellow;
|class=nowraplinks |
* Alpine skiing at the 1936 Winter Olympics
* Alpine skiing at the 1948 Winter Olympics
* Alpine skiing at the 1952 Winter Olympics
* Alpine skiing at the 1956 Winter Olympics
* Alpine skiing at the 1960 Winter Olympics
* Alpine skiing at the 1964 Winter Olympics
}}produces:
- Alpine skiing at the 1936 Winter Olympics
- Alpine skiing at the 1948 Winter Olympics
- Alpine skiing at the 1952 Winter Olympics
- Alpine skiing at the 1956 Winter Olympics
- Alpine skiing at the 1960 Winter Olympics
- Alpine skiing at the 1964 Winter Olympics
Technical details
This template uses the .hlist CSS class defined in the TemplateStyles to generate horizontal lists. It causes ordinary HTML list items to be displayed inline (horizontally), where they would normally display as block elements (vertically). The class also generates the interpuncts between list items and parentheses around nested lists.
| Wikitext | Expanded template | HTML |
|---|---|---|
{{flatlist|
* cat
* dog
* horse
* cow
* sheep
* pig
}}
|
<div class="hlist " > * cat * dog * horse * cow * sheep * pig </div> |
<div class="hlist">
<ul><li>cat</li>
<li>dog</li>
<li>horse</li>
<li>cow</li>
<li>sheep</li>
<li>pig</li></ul>
</div> |
See also
- {{multi-column numbered list}}
- {{nowrap}}
- {{pagelist}}
- {{Hlist}} – Uses Module:List
- Help:Lists