Template:Item: Difference between revisions
(added support for empty labels) |
(added support for "amount" of item) |
||
Line 13: | Line 13: | ||
|{{#var:item_icon_file}} | |{{#var:item_icon_file}} | ||
|{{#vardefine: item_label|{{{label|{{{l|{{#invoke: Item|lookup_item_name_by_id|{{#var:item_id}}<!--/invoke-->}}<!--/l-->}}}<!--/label-->}}}<!--/vardefine-->}}<!-- | |{{#vardefine: item_label|{{{label|{{{l|{{#invoke: Item|lookup_item_name_by_id|{{#var:item_id}}<!--/invoke-->}}<!--/l-->}}}<!--/label-->}}}<!--/vardefine-->}}<!-- | ||
-->{{#if: {{{2|}}}|{{#vardefine: item_label|{{{2}}} {{#var:item_label}}<!--/vardefine-->}}<!--/if-->}}<!-- | |||
--><span class="item"><!-- | --><span class="item"><!-- | ||
--><span class="item-icon">[[File:{{#var:item_icon_file}}|{{#var: item_icon_size}}]]</span><!-- | --><span class="item-icon">[[File:{{#var:item_icon_file}}|{{#var: item_icon_size}}]]</span><!-- | ||
-->{{#if: {{#var:item_label}}<!-- | -->{{#if: {{#var:item_label}}<!-- | ||
-->|<span class="item-label">''' | -->|<span class="item-label">'''{{#var:item_label}}'''</span><!-- | ||
-->}}<!-- | -->}}<!-- | ||
--></span> | --></span> | ||
Line 36: | Line 38: | ||
"description": "What item are you looking for? Any casing is allowed, including lowercase.", | "description": "What item are you looking for? Any casing is allowed, including lowercase.", | ||
"type": "line", | "type": "line", | ||
"required": true, | "example": "lv coil", | ||
"example": " | "default": "", | ||
"required": true | |||
}, | |||
"2": { | |||
"label": "Amount", | |||
"description": "Amount of item. Empty string by default.", | |||
"example": "3", | |||
"type": "number", | |||
"suggested": true | |||
}, | }, | ||
"size": { | "size": { | ||
Line 58: | Line 68: | ||
"paramOrder": [ | "paramOrder": [ | ||
"1", | "1", | ||
"2", | |||
"size", | "size", | ||
"label" | "label" |
Revision as of 13:21, 17 August 2024
Examples
Basic
{{item
↓
Script error: The function "lookup_item_id_by_name" does not exist.
For items without icons
Used here is some abstract item without icon.
{{item
↓
Script error: The function "lookup_item_id_by_name" does not exist.
Specifying amount of items
{{item
↓
Script error: The function "lookup_item_id_by_name" does not exist.
More examples
Custom label
{{item
↓
Script error: The function "lookup_item_id_by_name" does not exist.
Empty label
To remove the label alltogether, pass an empty string to label
.
{{item
↓
Script error: The function "lookup_item_id_by_name" does not exist.
Capitalizing the label
This makes the first letter of the label uppercase.
{{item
or
{{item
↓
Script error: The function "lookup_item_id_by_name" does not exist.
or
Script error: The function "lookup_item_id_by_name" does not exist.
Custom icon size
{{item
↓
Script error: The function "lookup_item_id_by_name" does not exist.
Adding links
{{item
↓
Script error: The function "lookup_item_id_by_name" does not exist.
A list of all items with icons
See Template:Item/doc/list of items with icons.
A list of all items
See Template:Item/doc/list_of_items.
Errors
Unknown item
{{item
↓
Script error: The function "lookup_item_id_by_name" does not exist.No description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Item | 1 | What item are you looking for? Any casing is allowed, including lowercase.
| Line | required |
Amount | 2 | Amount of item. Empty string by default.
| Number | suggested |
Size | size | Icon size
| Line | suggested |
Label | label l | Label override. | Line | suggested |