Template:Ordered list/doc: Difference between revisions

From HIBIKIFORUM
Jump to navigation Jump to search
(Created page with "{{Documentation subpage}} {{lua|Module:List}} {{tsh|olist}} __NOTOC__ == Usage == This template creates an ordered list, which is similar to a numbered list but may display other characters, such as roman numbers or alphabet letters, instead of the decimal enumerator. == Syntax == ; Simple : {{tji|Ordered list|entry1|entry2| ...}} ; Offset starting value : {{tji|Ordered list|start: start|entry1|entry2|... |item1_style: CSS1|item2_style: C...")
 
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 34: Line 34:
| The contents of each list item, as unnamed or positional parameters. There is no restriction on content, except equal signs (=) must be escaped or replaced with <code><nowiki>{{=}}</nowiki></code>, lest it will be interpreted a named parameter.
| The contents of each list item, as unnamed or positional parameters. There is no restriction on content, except equal signs (=) must be escaped or replaced with <code><nowiki>{{=}}</nowiki></code>, lest it will be interpreted a named parameter.
|-
|-
| {{code|itemN_value}}
| item''N''_value
{{para|item1_value}} {{para|item2_value}}
{{para|item1_value}} {{para|item2_value}}
| Ordinal or label for a specific list item; a positive integer.
| Ordinal or label for a specific list item; a positive integer.
|-
|-
| {{code|start}}
| {{para|start}}
| Ordinal or label for the first item in the list; a positive integer (default is 1).
| Ordinal or label for the first item in the list; a positive integer (default is 1).
|-
|-
| {{code|itemN_style}}
| item''N''_style
{{para|item1_style}} {{para|item2_style}}
{{para|item1_style}} {{para|item2_style}}
| [[Wikipedia:Cascading Style Sheet]] (CSS) styles that are set on a specific list item. (User must know CSS syntax.) For example, individual labels can be hidden by setting <code>item''n''_style=list-style-type:none;</code>
| [[Wikipedia:Cascading Style Sheet]] (CSS) styles that are set on a specific list item. (User must know CSS syntax.) For example, individual labels can be hidden by setting <code>item''n''_style=list-style-type:none;</code>
|-
|-
| {{code|item_style}}
| {{para|item_style}}
CSS-all
CSS-all
| CSS styles that are set on each list item. (User must know CSS syntax.) When present, any {{code|itemN_style}} are disregarded.
| CSS styles that are set on each list item. (User must know CSS syntax.) When present, any {{code|itemN_style}} are disregarded.
Line 120: Line 120:


<!-- Categories below this line, please -->
<!-- Categories below this line, please -->
[[Category:Templates]]
[[Category:List templates]]
[[Category:Formatting Templates]]
}}}}</includeonly>
}}}}</includeonly>

Latest revision as of 02:20, 20 August 2023

Light bulb.png }}
It contains usage information, categories and other content that is not part of the original template page.


Usage

This template creates an ordered list, which is similar to a numbered list but may display other characters, such as roman numbers or alphabet letters, instead of the decimal enumerator.

Syntax

Simple
{{Ordered list|entry1|entry2|...}}
Offset starting value
{{Ordered list|start=start|entry1|entry2|...|item1_style=CSS1|item2_style=CSS2|...}}
Changing the symbol style
{{Ordered list|list_style_type=type|entry1|entry2|...}}
With CSS style
{{Ordered list|item_style=CSS-all|entry1|entry2|...}}
With separate CSS styles for each item
{{Ordered list|entry1|item1_style=CSS1|entry2|item2_style=CSS2|...}}
With custom values for each item
{{Ordered list|item1_value=value1|entry1|item2_value=value2|entry2|...}}
Parameters' description
Parameter Description
|list_style_type= or
|list-style-type=

type

This parameter indicates the list style type. Popular acceptable parameters include:
  • decimal (1, 2, 3, 4, ...)
  • lower-roman (i, ii, iii, iv, ...)
  • upper-roman (I, II, III, IV, ...)
  • lower-alpha (a, b, c, d, ...)
  • upper-alpha (A, B, C, D, ...)

For a full list, see the following section.

Positional parameters

|entry1= |entry2=

The contents of each list item, as unnamed or positional parameters. There is no restriction on content, except equal signs (=) must be escaped or replaced with {{=}}, lest it will be interpreted a named parameter.
itemN_value

|item1_value= |item2_value=

Ordinal or label for a specific list item; a positive integer.
|start= Ordinal or label for the first item in the list; a positive integer (default is 1).
itemN_style

|item1_style= |item2_style=

Wikipedia:Cascading Style Sheet (CSS) styles that are set on a specific list item. (User must know CSS syntax.) For example, individual labels can be hidden by setting itemn_style=list-style-type:none;
|item_style=

CSS-all

CSS styles that are set on each list item. (User must know CSS syntax.) When present, any itemN_style are disregarded.

See Also

TemplateData

Make an ordered list. The default is a numbered list, but you can change it to a list with roman numbers or letters of the English, Greek, Armenian or Georgian alphabets, instead of the decimal enumerator.

Template parameters

ParameterDescriptionTypeStatus
Positional parameters1 2 3 4

The list items go here.

Stringrequired
Type of listlist_style_type

no description

Suggested values
none disc circle square decimal decimal-leading-zero lower-roman upper-roman lower-alpha upper-alpha lower-greek armenian georgian hebrew cjk-ideographic hiragana katakana hiragana-iroha katakana-iroha
Default
decimal
Stringoptional
Starting valuestart

If you want to start with something other than 1.

Default
1
Numberoptional
CSS styleitem_style

Custom CSS style for all of the list items.

Stringoptional
ItemN StyleitemN_style

Custom CSS styles for each of the list items. Where N is the item number.

Stringoptional