Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Plainlist/doc: Difference between revisions

Template page
Fix language-code links to use Wikipedia interwiki prefixes
 
(5 intermediate revisions by 5 users not shown)
Line 3: Line 3:
{{Uses TemplateStyles|Template:Plainlist/styles.css}}
{{Uses TemplateStyles|Template:Plainlist/styles.css}}


This template provides a [[:en:Web Content Accessibility Guidelines|WCAG]]/ISO-standards-compliant accessible alternative to {{tag|br|s}} separated lists, which should not be used.
This template provides a [[w:Web Content Accessibility Guidelines|WCAG]]/ISO-standards-compliant accessible alternative to {{tag|br|s}} separated lists, which should not be used.


== Usage ==
== Usage ==
{{tld|plainlist}} starts a plain (i.e. unbulleted) list. <!-- apparently this does not work on the template page at Commons
{{tld|Plainlist}} starts a plain (i.e. unbulleted) list. <!-- apparently this does not work on the template page at Commons
{{plainlist|
{{Plainlist|
* [[cat]]
* [[cat]]
* [[dog]]
* [[dog]]
Line 14: Line 14:
* [[sheep]]
* [[sheep]]
* [[pig]]
* [[pig]]
}}-->It uses proper HTML list markup, which is more standards-compliant and more accessible than separating list items with {{tag|br|s}}. Detailed reasons for using this template can be found at [[:en:WP:UBLIST|WP:UBLIST]].
}}-->It uses proper HTML list markup, which is more standards-compliant and more accessible than separating list items with {{tag|br|s}}. Detailed reasons for using this template can be found at [[w:WP:UBLIST|WP:UBLIST]].


== Examples ==
== Examples ==
<pre><nowiki>
<syntaxhighlight lang="wikitext">
{{plainlist|
{{Plainlist|
* [[cat]]
* [[cat]]
* [[dog]]
* [[dog]]
Line 26: Line 26:
* [[pig]]
* [[pig]]
}}
}}
</nowiki></pre>
</syntaxhighlight>
<!--{{plainlist|
<!--{{Plainlist|
* [[cat]]
* [[cat]]
* [[dog]]
* [[dog]]
Line 49: Line 49:
},
},
"description": {
"description": {
"en": "The list to wrap."
"en": "The items to include in the list. Each item list should be on its own line starting with an asterisk."
},
},
"example": "\n {{Plainlist|\n * item1\n * item2\n * item3\n }}\n",
"suggested": true,
"suggested": true,
"type": "content"
"type": "content"
Line 101: Line 102:


== See also ==
== See also ==
{{navbox lists}}
 
<includeonly>{{Sandbox other||
<includeonly>{{Sandbox other||
<!-- Categories below this line; interwikis at Wikidata -->
<!-- Categories below this line; interwikis at Wikidata -->

Latest revision as of 14:22, 15 August 2026

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

Usage

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

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

Parameters

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


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

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

Cookies help us deliver our services. By using our services, you agree to our use of cookies.