Template:Flatlist/doc

From Second Life Wiki
Jump to navigation Jump to search
"Template:Inline list" redirects here. For a navbox listing templates used within lines of text to mark problems needing attention, see Template:Inline cleanup tags.

TemplateStyles not installed on the Second Life Wiki! This template provides a "Wikipedia logo"WCAG/ISO-standards-compliant accessible alternative to comma- or dash- (or other single character-) separated lists, per "Wikipedia logo"WP:FLATLIST and "Wikipedia logo"WP:HLIST.

Usage

{{flatlist}} starts a horizontal list, such as:

This template can be used with or without {{endflatlist}}. For navigation boxes using {{navbox}}, one can set |listclass = hlist, and achieve the same styling without using this template. For image captions, list (i.e. asterisk) markup does not work, so consider using {{hlist}} instead.

Parameters

{{#switch:Template: Flatlist |#default=

{
	"description": {
		"en": "Used to create plain (i.e. unbulleted) lists."
	},
	"format": "inline",
	"params": {
		"1": {
			"label": {
				"en": "Content"
			},
			"description": {
				"en": "The list to wrap."
			},
			"suggested": true,
			"type": "content"
		},
		"class": {
			"label": {
				"en": "Extra Classes"
			},
			"description": {
				"en": "Adds extra CSS classes to the containing div."
			},
			"type": "string"
		},
		"style": {
			"label": {
				"en": "CSS Style"
			},
			"description": {
				"en": "Adds extra CSS properties to the containing div. Complex styles should not be used in articles (per {{Wikipedia|MOS:DEVIATIONS}}) but may be acceptable on user, project and talk pages."
			},
			"example": "\n border: solid 1px silver;\n background: lightyellow;\n",
			"type": "string"
		},
		"indent": {
			"label": {
				"en": "Indent"
			},
			"description": {
				"en": "Indents the list by a number of standard indents (one indent being 1.6[[em (typography)|em]]). (Useful in an indented discussion thread.)"
			},
			"example": "2",
			"type": "number"
		}
	},
	"paramOrder": [
		"class",
		"style",
		"indent",
		"1"
	]
}

Examples

{{flatlist|
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
}}

produces:

Alternative syntax

{{startflatlist}}
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
{{endflatlist}}

produces:

Syntax for ordered lists

{{flatlist|
# [[first]]
# [[second]]
# [[third]]
# [[fourth]]
# [[fifth]]
# [[sixth]]
}}

produces:

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:

Technical details

This template uses the .hlist "Wikipedia logo"CSS class defined in "Wikipedia logo"MediaWiki:Common.css 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 "Wikipedia logo"interpuncts between list items and parentheses around nested lists. Some of the CSS used is not compatible with some older browsers, notably Internet Explorer 6 and 7.

Wikitext Expanded template HTML
{{flatlist|
* cat
* dog
* horse
* cow
* sheep
* pig
}}
Template:Nowiki2
<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

Flat
{{hlist}}
{{hlist |item1 |item2 |...}}

  • item1
  • item2
  • ...
{{flatlist}}
{{flatlist|
* item1
* item2
* ...}}

  • item1
  • item2
  • ...
{{cslist}}
{{cslist |item1 |item2 |...}}

Template:Cslist

{{bold list}}
{{bold list |item1 |item2 |...}}

Template:Bold list

Bulleted and Ordered
{{bulleted list}}
{{bulleted list |item1 |item2 |...}}


{{ordered list}}
{{Ordered list |list_style_type=lower-alpha |first |second |...}}

Template:Ordered list

Unbulleted
{{unbulleted list}}
{{unbulleted list |item1 |item2 |...}}

  • item1
  • item2
  • ...
{{plainlist}}
{{plainlist|
* item1
* item2
* ...}}

  • item1
  • item2
  • ...
{{glossary}}
(glossary, description, definition, association)
{{glossary}}

{{term|first term}} {{defn|first description}}
{{term|second term}} {{defn|second description}}
{{term|...}} {{defn|....}}
{{glossary end}}


Template:Glossary

first term
Template:Defn
second term
Template:Defn
...
Template:Defn Template:Glossary end
Other
{{flowlist}}
[[File:Bad Title Example.png|left|thumb|100px]]

{{flowlist|
*item1
*item2
*...}}


Bad Title Example.png

Template:Flowlist

{{columns-list}}
{{columns-list|colwidth=5em|
# first
# second
# third
# ...}}

Template:Columns-list

Template:Navbox bottom