Jump to content

Template:Item/doc: Difference between revisions

From The Petit Planet Wiki
mNo edit summary
Standardizing parameter naming convention to snake_case
Line 15: Line 15:
* {{F|link}} – Set another page to be linked.
* {{F|link}} – Set another page to be linked.
* {{F|text}} – Display another text instead of the name of the item.
* {{F|text}} – Display another text instead of the name of the item.
* {{F|notext}} – Set to {{F|1}} to omit the complete text. The icon will no longer behave like an inline-block.
* {{F|no_text}} – Set to {{F|1}} to omit the complete text. The icon will no longer behave like an inline-block.
* {{F|note}} – Append a note after the item text and count.
* {{F|note}} – Append a note after the item text and count.
* {{F|ref}} – Append a reference to the item text.
* {{F|ref}} – Append a reference to the item text.
* {{F|comma}} – Set to {{F|1}} to append a comma to the item text following AmE rules.
* {{F|comma}} – Set to {{F|1}} to append a comma to the item text following AmE rules.
* {{F|dot}} – Set to {{F|1}} to append a dot to the item text following AmE rules.
* {{F|dot}} – Set to {{F|1}} to append a dot to the item text following AmE rules.
* {{F|commaspc}} – Set to {{F|1}} to append a comma and a space to the item text following AmE rules.
* {{F|comma_spc}} – Set to {{F|1}} to append a comma and a space to the item text following AmE rules.
* {{F|dotspc}} – Set to {{F|1}} to append a dot and a space to the item text following AmE rules.
* {{F|dot_spc}} – Set to {{F|1}} to append a dot and a space to the item text following AmE rules.


==Examples==
==Examples==
Line 29: Line 29:
{{T|Item|p1=Kabuto Beetle|p2=40|_Ybr_=1}}<br />
{{T|Item|p1=Kabuto Beetle|p2=40|_Ybr_=1}}<br />
{{T|Item|p1=Kabuto Beetle|p2=link=Insect|p3=text=Custom text|_Ybr_=1}}<br />
{{T|Item|p1=Kabuto Beetle|p2=link=Insect|p3=text=Custom text|_Ybr_=1}}<br />
{{T|Item|p1=Dough|p2=x=15|p3=notext=1|_Ybr_=1}}<br />
{{T|Item|p1=Dough|p2=x=15|p3=no_text=1|_Ybr_=1}}<br />
{{T|Item|p1=Elsasani|_Ybr_=1}}<br />
{{T|Item|p1=Elsasani|_Ybr_=1}}<br />
{{T|Item|p1=Hexia|p2=note=Galaxy|_Ybr_=1}}
{{T|Item|p1=Hexia|p2=note=Galaxy|_Ybr_=1}}
Line 77: Line 77:
"type": "wiki-page-name",
"type": "wiki-page-name",
"default": "<1>, <name>"
"default": "<1>, <name>"
},
"notext": {
"label": "No text",
"description": "Set to 1 to omit the complete text.",
"example": "1",
"type": "boolean"
},
},
"note": {
"note": {
Line 106: Line 100:
"type": "boolean"
"type": "boolean"
},
},
"commaspc": {
"comma_spc": {
"label": "Comma and space",
"label": "Comma and space",
"description": "Set to 1 to append a comma and a space to the item text following AmE rules.",
"description": "Set to 1 to append a comma and a space to the item text following AmE rules.",
Line 112: Line 106:
"type": "boolean"
"type": "boolean"
},
},
"dotspc": {
"dot_spc": {
"label": "Dot and space",
"label": "Dot and space",
"description": "Set to 1 to append a dot and a space to the item text following AmE rules.",
"description": "Set to 1 to append a dot and a space to the item text following AmE rules.",
"example": "1",
"type": "boolean"
},
"no_text": {
"label": "No text",
"description": "Set to 1 to omit the complete text.",
"example": "1",
"example": "1",
"type": "boolean"
"type": "boolean"
Line 120: Line 120:
},
},
"description": "Template that adds a link to icons.",
"description": "Template that adds a link to icons.",
"format": "inline"
"format": "inline",
"paramOrder": [
"1",
"2",
"x",
"type",
"link",
"no_text",
"note",
"ref",
"comma",
"dot",
"comma_spc",
"dot_spc"
]
}
}
</templatedata>
</templatedata>

Revision as of 10:51, 4 May 2026

This is the documentation page for Item.
It contains usage information, categories, and other content not part of the original template page.
This template uses Module:Item, a script written in Lua.
This template uses CSS found at MediaWiki:Gadget-Item.css.

Template that adds a link to icons.

Syntax

{{Item|}}

This template has 2 unnamed parameters:

  • 1 / name – Name of the item.
  • 2 / size – Size of the icon. Default: 30.
  • x / count – Quantity of the item. Part of the text.
  • type – Special keyword to adjust the file's suffix and prefix.
  • link – Set another page to be linked.
  • text – Display another text instead of the name of the item.
  • no_text – Set to 1 to omit the complete text. The icon will no longer behave like an inline-block.
  • note – Append a note after the item text and count.
  • ref – Append a reference to the item text.
  • comma – Set to 1 to append a comma to the item text following AmE rules.
  • dot – Set to 1 to append a dot to the item text following AmE rules.
  • comma_spc – Set to 1 to append a comma and a space to the item text following AmE rules.
  • dot_spc – Set to 1 to append a dot and a space to the item text following AmE rules.

Examples

{{Item}} yields:
Unknown Unknown
{{Item|Unknown}} yields:
Unknown Unknown
{{Item|Kabuto Beetle}} yields:
Kabuto Beetle Kabuto Beetle
{{Item|Kabuto Beetle|40}} yields:
Kabuto Beetle Kabuto Beetle
{{Item|Kabuto Beetle|link = Insect|text = Custom text}} yields:
Kabuto Beetle Custom text
{{Item|Dough|x = 15|no_text = 1}} yields:
Dough×15
{{Item|Elsasani}} yields:
Elsasani Elsasani
{{Item|Hexia|note = Galaxy}} yields:
Hexia Hexia (Galaxy)

Template Data

Template that adds a link to icons.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Item1 name

Name of the item.

Example
Dough
Stringrequired
Size2 size

Size of the icon.

Default
30
Example
20, 40
Numberoptional
Quantityx count

Quantity of the item.

Example
1, 5, 10
Numberoptional
Typetype

Special keyword to adjust the file's suffix and prefix.

Default
Item
Stringoptional
Linklink

Set another page to be linked.

Default
<1>, <name>
Page nameoptional
No textno_text

Set to 1 to omit the complete text.

Example
1
Booleanoptional
Notenote

Append a note after the item text and count.

Stringoptional
Referenceref

Append a reference to the item text.

Stringoptional
Commacomma

Set to 1 to append a comma to the item text following AmE rules.

Example
1
Booleanoptional
Dotdot

Set to 1 to append a dot to the item text following AmE rules.

Example
1
Booleanoptional
Comma and spacecomma_spc

Set to 1 to append a comma and a space to the item text following AmE rules.

Example
1
Booleanoptional
Dot and spacedot_spc

Set to 1 to append a dot and a space to the item text following AmE rules.

Example
1
Booleanoptional