Template:Flatlist: Difference between revisions
Appearance
| [unchecked revision] | [unchecked revision] |
Content deleted Content added
Caleb Cooper (talk | contribs) Undo revision 10668 by Caleb Cooper (talk) Tag: Undo |
Caleb Cooper (talk | contribs) m 1 revision imported |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<div class="hlist hlist-separated {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}| |
|||
{{<includeonly>safesubst:</includeonly>#invoke:list|horizontal}} |
|||
{{{1}}} |
|||
<noinclude> |
|||
</div>}}<noinclude></div> |
|||
{{documentation}} |
|||
</noinclude> |
|||
==Usage== |
|||
{{tlf|flatlist}} starts a horizontal list, such as: |
|||
{{flatlist| |
|||
* [[cat]] |
|||
* [[dog]] |
|||
* [[horse]] |
|||
* [[cow]] |
|||
* [[sheep]] |
|||
* [[pig]] |
|||
}} |
|||
This template can be used with or without {{tl|endflatlist}}. For navigation boxes using {{tl|navbox}}, one can set {{para|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 {{tl|hlist}} instead. |
|||
==Optional parameters== |
|||
; class |
|||
: Adds a CSS class to the containing div. Use <tt>nowraplinks</tt> to prevent links from wrapping. |
|||
; style |
|||
: Adds CSS styling to the containing div. Complex styles should not be used in articles but may be acceptable on user, project and talk pages. |
|||
: Example: {{para|<var>style</var>|<var>border:solid 1px silver; background:lightyellow</var>}} |
|||
; indent |
|||
: Indents the list by a number of standard indents, one indent being 1.6[[Em (typography)|em]]. (Useful in an indented discussion thread.) |
|||
: Example: {{para|<var>indent</var>|<var>2</var>}} |
|||
==Examples== |
|||
<source lang="moin"> |
|||
{{flatlist| |
|||
* [[cat]] |
|||
* [[dog]] |
|||
* [[horse]] |
|||
* [[cow]] |
|||
* [[sheep]] |
|||
* [[pig]] |
|||
}} |
|||
</source> |
|||
produces: |
|||
{{flatlist| |
|||
* [[cat]] |
|||
* [[dog]] |
|||
* [[horse]] |
|||
* [[cow]] |
|||
* [[sheep]] |
|||
* [[pig]] |
|||
}} |
|||
===Alternative syntax=== |
|||
<source lang="moin"> |
|||
{{startflatlist}} |
|||
* [[cat]] |
|||
* [[dog]] |
|||
* [[horse]] |
|||
* [[cow]] |
|||
* [[sheep]] |
|||
* [[pig]] |
|||
{{endflatlist}} |
|||
</source> |
|||
produces: |
|||
{{startflatlist}} |
|||
* [[cat]] |
|||
* [[dog]] |
|||
* [[horse]] |
|||
* [[cow]] |
|||
* [[sheep]] |
|||
* [[pig]] |
|||
{{endflatlist}} |
|||
===Syntax for ordered lists=== |
|||
<pre> |
|||
{{flatlist| |
|||
# [[first]] |
|||
# [[second]] |
|||
# [[third]] |
|||
# [[fourth]] |
|||
# [[fifth]] |
|||
# [[sixth]] |
|||
}} |
|||
</pre> |
|||
produces: |
|||
{{flatlist| |
|||
# [[first]] |
|||
# [[second]] |
|||
# [[third]] |
|||
# [[fourth]] |
|||
# [[fifth]] |
|||
# [[sixth]] |
|||
}} |
|||
=== Using optional parameters === |
|||
<source lang="moin"> |
|||
{{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]] |
|||
}} |
|||
</source> |
|||
produces: |
|||
{{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]] |
|||
}} |
|||
[[Category:AutoDumpContentFromCommons]]</noinclude> |
|||