Difference between revisions of "Template:Plainlist"

From Wikispooks
Jump to navigation Jump to search
m (1 revision: templatee needed by infobox)
 
m (1 revision imported)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<div class="plainlist {{{class|}}}" style="margin-left: {{#expr:{{{indent|0}}}*1.6}}em; {{{style|}}}">{{#if:{{{1|}}}|
+
<div class="plainlist {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}|
 
{{{1}}}
 
{{{1}}}
 
</div>}}<noinclude></div>
 
</div>}}<noinclude></div>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 10:02, 2 December 2015

Template documentation[view] [edit] [history] [purge]

Usage

{{Plainlist}} starts a plain, or unbulleted, list, such as:

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.

This template can be used with or without {{endplainlist}}. It is an alternative to {{Unbulleted list}}, which performs the same function in a more concise but less wiki-style manner. Note that {{Unbulleted list}} will work inside image captions, whereas {{Plainlist}} does not.

Examples

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

NB Already indented lists

Put {{Plainlist| at the start of a line, not indented itself. (It doesn't affect the display of the list itself, but it will affect any surrounding <div>-based formatting.)

{{Plainlist |
:* [[cat]]
:* [[dog]]
:* [[horse]]
:* [[cow]]
:* [[sheep]]
:* [[pig]]
}}
Alternative syntax
{{Plainlist}}
:* [[cat]]
:* [[dog]]
:* [[horse]]
:* [[cow]]
:* [[sheep]]
:* [[pig]]
{{endplainlist}}

Parameters

  • class – adds a CSS class to the containing div.
  • style – adds CSS style options. Complex styles should not be used in articles (per wp:deviations) but may be acceptable on user, project, and talk pages.
Example: |style=border:solid 1px silver; background:lightyellow
  • indent – indents the list by a number of standard indents (one indent being 1.6em), particularly handy for inclusion in an indented discussion thread.
Example: |indent=2

Method

{{Plainlist}} works by constructing a div with the CSS class "plainlist" which has the following style: <source lang="css">.plainlist ul {line-height:inherit; list-style:none none; margin:0} .plainlist ul li {margin-bottom:0}</source>

See also