Jump to content

Template:Nested Lists/doc

From The Petit Planet Wiki
This is the documentation page for Nested Lists.
It contains usage information, categories, and other content not part of the original template page.

This template creates a nested list from a semicolon-separated input, with different symbols used to specify the indentation level. It can optionally link items to existing pages and display icons given a specific file name format or custom image file name.

Syntax

[edit source]

{{Nested Lists|Item 1;Item 2;//Item 2.1;//Item 2.2;$$Item 2.2.1;Item 3|link = 1|icon = Icon Furniture {item}.png|icon_size = 25}}

  • The first parameter contains the list items, separated by semicolons ;.
  • The indentation of each item is determined by the symbol immediately before it:
    • ; — level 0
    • // — level 1
    • $$ — level 2
    • %% — level 3
    • && — level 4
  • link=1 checks whether each item's page exists and links the item when it does.
  • icon= adds an icon to every item. {item} is replaced with the item's page name.
  • icon_size= sets the icon size in pixels. The default is 25.
  • [no] at the beginning of an item disables its icon.
  • [custom icon] at the beginning of an item disables its icon.
  • An item can use page{{!}}label to specify a page separately from its displayed label.

Examples

[edit source]

Basic List

[edit source]

{{Nested Lists|Item 1;Item 2;//Item 2.1;//Item 2.2;$$Item 2.2.1;Item 3}} yields:

  • Item 1
  • Item 2
    • Item 2.1
    • Item 2.2
      • Item 2.2.1
  • Item 3
[edit source]

{{Nested Lists|Hexia;//Dorjelang;//Yunguo;$$Red;Other Galaxy|link = 1}} yields:

With Icons

[edit source]

{{Nested Lists|Basic Furniture;//Beds;//Seating|icon = Icon Furniture {item}.png}} yields:

  • Basic Furniture
    • Beds
    • Seating
[edit source]

{{Nested Lists|Basic Furniture;//Beds;//Seating|link = 1|icon = Icon Furniture {item}.png}} yields:

Custom Icon Size

[edit source]

{{Nested Lists|Basic Furniture;//Beds;//Seating|icon = Icon Furniture {item}.png|icon_size = 40}} yields:

  • Basic Furniture
    • Beds
    • Seating

Disabling an Icon

[edit source]

{{Nested Lists|Basic Furniture;//[no]Beds;//Seating|icon = Icon Furniture {item}.png}} yields:

  • Basic Furniture
    • Beds
    • Seating

Custom Icon

[edit source]

{{Nested Lists|Basic Furniture;//Beds;//Seating;$$[Hexia Icon.png]Hexia}} yields:

  • Basic Furniture
    • Beds
    • Seating
      • Hexia
[edit source]

{{Nested Lists|Beds|Wooden Chair;Tables|Dining Table;//Tables|Small Table|link = 1}} yields:

Combining Features

[edit source]

{{Nested Lists|[no]Furniture;Seating|Wooden Chair;//Tables|Dining Table;$$[no]Lamp|Desk Lamp;%%[no]Special Item|link = 1|icon = Icon Furniture {item}.png|icon_size = 30}} yields:

Template Data

[edit source]

Creates a nested list from a semicolon-separated input. The symbols //, $$, %%, and && specify indentation levels. Items can optionally be linked to existing pages and given automatically generated icons.

Template parameters

ParameterDescriptionTypeStatus
List1

Semicolon-separated list of items. Use //, $$, %%, or && before an item to set its indentation level.

Stringrequired
Linklink

If set to 1, checks whether each item's page exists and links the item when it does.

Default
0
Booleanoptional
Iconicon

Icon filename format to use for every item. Use {item} as a placeholder for the item's page name.

Stringoptional
Icon sizeicon_size

Size of the icons in pixels. Defaults to 25.

Default
25
Numberoptional