Difference between revisions of "Template:Hlist"

From Krafties
Jump to navigation Jump to search
(Created page with "{{<includeonly>safesubst:</includeonly>#invoke:list|horizontal}}<noinclude> {{documentation}} <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noin...")
 
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{<includeonly>safesubst:</includeonly>#invoke:list|horizontal}}<noinclude>
+
<div class="hlist {{{class|}}}" style="margin-left:{{#expr:{{{indent|0}}}*1.6}}em;{{{style|}}}"><!--
{{documentation}}
+
 
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
+
----------(unbulleted list code:)----------
 +
-->{{#if:{{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}{{{6|}}}{{{7|}}}{{{8|}}}{{{9|}}}{{{10|}}}{{{11|}}}{{{12|}}}{{{13|}}}{{{14|}}}{{{15|}}}{{{16|}}}{{{17|}}}{{{18|}}}{{{19|}}}{{{20|}}}{{{21|}}}{{{22|}}}{{{23|}}}{{{24|}}}{{{25|}}}{{{26|}}}{{{27|}}}{{{28|}}}{{{29|}}}{{{30|}}}{{{31|}}}{{{32|}}}{{{33|}}}{{{34|}}}{{{35|}}}{{{36|}}}{{{37|}}}{{{38|}}}{{{39|}}}{{{40|}}}{{{41|}}}{{{42|}}}{{{43|}}}{{{44|}}}{{{45|}}}{{{46|}}}{{{47|}}}{{{48|}}}{{{49|}}}{{{50|}}}{{{51|}}}{{{52|}}}{{{53|}}}{{{54|}}}{{{55|}}}{{{56|}}}{{{57|}}}{{{58|}}}{{{59|}}}{{{60|}}}
 +
    |<div class="plainlist"><!--
 +
      --><ul style="{{{ul_style|}}}"><!--
 +
          -->{{#if:{{{1|}}}|<li style="{{{li_style|}}}{{{li_style1|}}}">{{{1}}}</li>}}<!--
 +
          -->{{#if:{{{2|}}}|<li style="{{{li_style|}}}{{{li_style2|}}}">{{{2}}}</li>}}<!--
 +
          -->{{#if:{{{3|}}}|<li style="{{{li_style|}}}{{{li_style3|}}}">{{{3}}}</li>}}<!--
 +
          -->{{#if:{{{4|}}}|<li style="{{{li_style|}}}{{{li_style4|}}}">{{{4}}}</li>}}<!--
 +
          -->{{#if:{{{5|}}}|<li style="{{{li_style|}}}{{{li_style5|}}}">{{{5}}}</li>}}<!--
 +
          -->{{#if:{{{6|}}}|<li style="{{{li_style|}}}{{{li_style6|}}}">{{{6}}}</li>}}<!--
 +
          -->{{#if:{{{7|}}}|<li style="{{{li_style|}}}{{{li_style7|}}}">{{{7}}}</li>}}<!--
 +
          -->{{#if:{{{8|}}}|<li style="{{{li_style|}}}{{{li_style8|}}}">{{{8}}}</li>}}<!--
 +
          -->{{#if:{{{9|}}}|<li style="{{{li_style|}}}{{{li_style9|}}}" >{{{9}}}</li>}}<!--
 +
          -->{{#if:{{{10|}}}|<li style="{{{li_style|}}}{{{li_style10|}}}">{{{10}}}</li>}}<!--
 +
          -->{{#if:{{{11|}}}|<li style="{{{li_style|}}}{{{li_style11|}}}">{{{11}}}</li>}}<!--
 +
          -->{{#if:{{{12|}}}|<li style="{{{li_style|}}}{{{li_style12|}}}">{{{12}}}</li>}}<!--
 +
          -->{{#if:{{{13|}}}|<li style="{{{li_style|}}}{{{li_style13|}}}">{{{13}}}</li>}}<!--
 +
          -->{{#if:{{{14|}}}|<li style="{{{li_style|}}}{{{li_style14|}}}">{{{14}}}</li>}}<!--
 +
          -->{{#if:{{{15|}}}|<li style="{{{li_style|}}}{{{li_style15|}}}">{{{15}}}</li>}}<!--
 +
          -->{{#if:{{{16|}}}|<li style="{{{li_style|}}}{{{li_style16|}}}">{{{16}}}</li>}}<!--
 +
          -->{{#if:{{{17|}}}|<li style="{{{li_style|}}}{{{li_style17|}}}">{{{17}}}</li>}}<!--
 +
          -->{{#if:{{{18|}}}|<li style="{{{li_style|}}}{{{li_style18|}}}">{{{18}}}</li>}}<!--
 +
          -->{{#if:{{{19|}}}|<li style="{{{li_style|}}}{{{li_style19|}}}">{{{19}}}</li>}}<!--
 +
          -->{{#if:{{{20|}}}|<li style="{{{li_style|}}}{{{li_style20|}}}">{{{20}}}</li>}}<!--
 +
          -->{{#if:{{{21|}}}|<li style="{{{li_style|}}}{{{li_style21|}}}">{{{21}}}</li>}}<!--
 +
          -->{{#if:{{{22|}}}|<li style="{{{li_style|}}}{{{li_style22|}}}">{{{22}}}</li>}}<!--
 +
          -->{{#if:{{{23|}}}|<li style="{{{li_style|}}}{{{li_style23|}}}">{{{23}}}</li>}}<!--
 +
          -->{{#if:{{{24|}}}|<li style="{{{li_style|}}}{{{li_style24|}}}">{{{24}}}</li>}}<!--
 +
          -->{{#if:{{{25|}}}|<li style="{{{li_style|}}}{{{li_style25|}}}">{{{25}}}</li>}}<!--
 +
          -->{{#if:{{{26|}}}|<li style="{{{li_style|}}}{{{li_style26|}}}">{{{26}}}</li>}}<!--
 +
          -->{{#if:{{{27|}}}|<li style="{{{li_style|}}}{{{li_style27|}}}">{{{27}}}</li>}}<!--
 +
          -->{{#if:{{{28|}}}|<li style="{{{li_style|}}}{{{li_style28|}}}">{{{28}}}</li>}}<!--
 +
          -->{{#if:{{{29|}}}|<li style="{{{li_style|}}}{{{li_style29|}}}">{{{29}}}</li>}}<!--
 +
          -->{{#if:{{{30|}}}|<li style="{{{li_style|}}}{{{li_style30|}}}">{{{30}}}</li>}}<!--
 +
          -->{{#if:{{{31|}}}|<li style="{{{li_style|}}}{{{li_style31|}}}">{{{31}}}</li>}}<!--
 +
          -->{{#if:{{{32|}}}|<li style="{{{li_style|}}}{{{li_style32|}}}">{{{32}}}</li>}}<!--
 +
          -->{{#if:{{{33|}}}|<li style="{{{li_style|}}}{{{li_style33|}}}">{{{33}}}</li>}}<!--
 +
          -->{{#if:{{{34|}}}|<li style="{{{li_style|}}}{{{li_style34|}}}">{{{34}}}</li>}}<!--
 +
          -->{{#if:{{{35|}}}|<li style="{{{li_style|}}}{{{li_style35|}}}">{{{35}}}</li>}}<!--
 +
          -->{{#if:{{{36|}}}|<li style="{{{li_style|}}}{{{li_style36|}}}">{{{36}}}</li>}}<!--
 +
          -->{{#if:{{{37|}}}|<li style="{{{li_style|}}}{{{li_style37|}}}">{{{37}}}</li>}}<!--
 +
          -->{{#if:{{{38|}}}|<li style="{{{li_style|}}}{{{li_style38|}}}">{{{38}}}</li>}}<!--
 +
          -->{{#if:{{{39|}}}|<li style="{{{li_style|}}}{{{li_style39|}}}">{{{39}}}</li>}}<!--
 +
          -->{{#if:{{{40|}}}|<li style="{{{li_style|}}}{{{li_style40|}}}">{{{40}}}</li>}}<!--
 +
          -->{{#if:{{{41|}}}|<li style="{{{li_style|}}}{{{li_style41|}}}">{{{41}}}</li>}}<!--
 +
          -->{{#if:{{{42|}}}|<li style="{{{li_style|}}}{{{li_style42|}}}">{{{42}}}</li>}}<!--
 +
          -->{{#if:{{{43|}}}|<li style="{{{li_style|}}}{{{li_style43|}}}">{{{43}}}</li>}}<!--
 +
          -->{{#if:{{{44|}}}|<li style="{{{li_style|}}}{{{li_style44|}}}">{{{44}}}</li>}}<!--
 +
          -->{{#if:{{{45|}}}|<li style="{{{li_style|}}}{{{li_style45|}}}">{{{45}}}</li>}}<!--
 +
          -->{{#if:{{{46|}}}|<li style="{{{li_style|}}}{{{li_style46|}}}">{{{46}}}</li>}}<!--
 +
          -->{{#if:{{{47|}}}|<li style="{{{li_style|}}}{{{li_style47|}}}">{{{47}}}</li>}}<!--
 +
          -->{{#if:{{{48|}}}|<li style="{{{li_style|}}}{{{li_style48|}}}">{{{48}}}</li>}}<!--
 +
          -->{{#if:{{{49|}}}|<li style="{{{li_style|}}}{{{li_style49|}}}">{{{49}}}</li>}}<!--
 +
          -->{{#if:{{{50|}}}|<li style="{{{li_style|}}}{{{li_style50|}}}">{{{50}}}</li>}}<!--
 +
          -->{{#if:{{{51|}}}|<li style="{{{li_style|}}}{{{li_style51|}}}">{{{51}}}</li>}}<!--
 +
          -->{{#if:{{{52|}}}|<li style="{{{li_style|}}}{{{li_style52|}}}">{{{52}}}</li>}}<!--
 +
          -->{{#if:{{{53|}}}|<li style="{{{li_style|}}}{{{li_style53|}}}">{{{53}}}</li>}}<!--
 +
          -->{{#if:{{{54|}}}|<li style="{{{li_style|}}}{{{li_style54|}}}">{{{54}}}</li>}}<!--
 +
          -->{{#if:{{{55|}}}|<li style="{{{li_style|}}}{{{li_style55|}}}">{{{55}}}</li>}}<!--
 +
          -->{{#if:{{{56|}}}|<li style="{{{li_style|}}}{{{li_style56|}}}">{{{56}}}</li>}}<!--
 +
          -->{{#if:{{{57|}}}|<li style="{{{li_style|}}}{{{li_style57|}}}">{{{57}}}</li>}}<!--
 +
          -->{{#if:{{{58|}}}|<li style="{{{li_style|}}}{{{li_style58|}}}">{{{58}}}</li>}}<!--
 +
          -->{{#if:{{{59|}}}|<li style="{{{li_style|}}}{{{li_style59|}}}">{{{59}}}</li>}}<!--
 +
          -->{{#if:{{{60|}}}|<li style="{{{li_style|}}}{{{li_style60|}}}">{{{60}}}</li>}}<!--
 +
      --></ul><!--
 +
  --></div><!--
 +
-->}}<!--
 +
  ----------(unbulleted list code ends)----------
 +
 
 +
--></div><noinclude>{{Documentation}}
 +
[[Category:Formatting templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 03:00, 4 May 2017

Documentation icon Template documentation ( view · talk · edit)


This template creates horizontal lists. Each item in the list may have CSS styles added to it individually, by appending a numbered parameter.

Usage[edit]

Basic usage

{{hlist|''first item''|''second item''|''third item''|...}}

All parameters

{{hlist
|''first item''|''second item''|''third item''|...
|class     = ''class''
|style     = ''style''
|ul_style  = ''style for ul tag''
|li_style  = ''style for all li tags''
|li_style1 = ''style for first li tag'' |li_style2 = ''style for second li tag'' |...
|indent    = ''indent for the list''
}}

Parameters[edit]

  • Positional parameters (1, 2, 3...) - these are the list items. If no list items are present, the module will output nothing.
  • class - a custom class for the <div>...</div> tags surrounding the list, e.g. plainlinks.
  • style - a custom css style for the <div>...</div> tags surrounding the list, e.g. font-size: 90%;.
  • list_style - a custom css style for the <ul>...</ul> tags around the list. The format is the same as for the |style= parameter.
  • item_style - a custom css style for all of the list items (the <li>...</li> tags). The format is the same as for the |style= parameter.
  • item1_style, item2_style, item3_style... - custom css styles for each of the list items. The format is the same as for the |style= parameter.
  • indent - this parameter indents the list. The value must be a number, e.g. 2. The indent is calculated in em, and is 1.6 times the value specified. If no indent is specified, the default is zero.

Examples[edit]

Markup [[:Template: Renders as
{{hlist|entry1|entry2|entry3|entry4|entry5|entry6|entry7|entry8|entry9}}
  • entry1
  • entry2
  • entry3
  • entry4
  • entry5
  • entry6
  • entry7
  • entry8
  • entry9
{{hlist|Winner|Runner-up|Third place|item_style=color:blue;}}
  • Winner
  • Runner-up
  • Third place
{{hlist|Winner|Runner-up|Third place|item_style=color:blue;|indent=2}}
  • Winner
  • Runner-up
  • Third place
{{hlist|Winner|Runner-up|Third place|item1_style=background-color:yellow;|item2_style=background-color:silver;}}
  • Winner
  • Runner-up
  • Third place

See also[edit]

The above documentation is transcluded from Template:Hlist/doc.
Editors can experiment in this template's sandbox
Please add categories to the /doc subpage within <includeonly>...</includeonly>