Template:Plainlist

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Plainlist/doc.

This template provides a WCAG/ISO-standards-compliant accessible alternative to ‎<br /> separated lists, which should not be used.

Usage[edit]

{{plainlist}} starts a plain (i.e. unbulleted) list. It uses proper HTML list markup, which is more standards-compliant and more accessible than separating list items with ‎<br />. Detailed reasons for using this template can be found at WP:UBLIST.

Examples[edit]

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

Parameters[edit]

<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.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

Used to create plain (i.e. unbulleted) lists.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Extra Classesclass

Adds extra CSS classes to the containing div.

Stringoptional
CSS Stylestyle

Adds extra CSS properties. Complex styles should not be used in articles (per [[w:MOS:DEVIATIONS]]) but may be acceptable on user, project, and talk pages.

Example
border: solid 1px silver;
background: lightyellow;
Stringoptional
Indentindent

Indents the list by a number of standard indents (one indent being 1.6em), particularly handy for inclusion in an indented discussion thread.

Example
2
Numberoptional
Content1

The items to include in the list. Each item list should be on its own line starting with an asterisk.

Example
{{Plainlist|
* item1
* item2
* item3
}}
Contentsuggested

Method[edit]

{{plainlist}} works by constructing a div with the CSS class "plainlist" which has the following style:

/* Should be kept in sync with [[MediaWiki:Common.css]] */

/**
 * Unbulleted lists
 */
.plainlist ul {
	line-height: inherit;
	list-style: none none;
	margin: 0;
}

.plainlist ul li {
	margin-bottom: 0;
}

See also[edit]

Template:Navbox lists