Template:Item: Difference between revisions
(changes due to update to Module:Item) |
(added a "capitalize" param) |
||
Line 15: | Line 15: | ||
-->{{#if: {{{2|}}}|{{#vardefine: item_label|{{{2}}} {{#var:item_label}}<!--/vardefine-->}}<!--/if-->}}<!-- | -->{{#if: {{{2|}}}|{{#vardefine: item_label|{{{2}}} {{#var:item_label}}<!--/vardefine-->}}<!--/if-->}}<!-- | ||
-->{{#ifeq: {{{capitalize|{{{cap|0}}}<!--/1-->}}}|1|{{#vardefine: item_label|{{ucfirst:{{#var:item_label}}}}<!--/vardef-->}}<!--/if-->}}<!-- | |||
--><span class="item"><!-- | --><span class="item"><!-- | ||
Line 39: | Line 41: | ||
"type": "line", | "type": "line", | ||
"example": "lv coil", | "example": "lv coil", | ||
"required": true | "required": true | ||
}, | }, | ||
Line 64: | Line 65: | ||
"l" | "l" | ||
] | ] | ||
}, | |||
"capitalize": { | |||
"aliases": [ | |||
"cap" | |||
], | |||
"label": "Capitalize", | |||
"description": "Makes the first letter in the label uppercase.", | |||
"type": "boolean", | |||
"autovalue": "0" | |||
} | } | ||
}, | }, | ||
Line 70: | Line 80: | ||
"2", | "2", | ||
"size", | "size", | ||
"label" | "label", | ||
"capitalize" | |||
] | ] | ||
} | } | ||
</templatedata> | </templatedata> | ||
</noinclude> | </noinclude> |
Revision as of 00:10, 20 August 2024
Examples
Basic
{{item
↓
Script error: The function "lookup_item_id_by_name_and_amount" 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_and_amount" does not exist.
Specifying amount of items
{{item
↓
Script error: The function "lookup_item_id_by_name_and_amount" does not exist.
More examples
Custom label
{{item
↓
Script error: The function "lookup_item_id_by_name_and_amount" 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_and_amount" 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_and_amount" does not exist.
or
Script error: The function "lookup_item_id_by_name_and_amount" does not exist.
Custom icon size
{{item
↓
Script error: The function "lookup_item_id_by_name_and_amount" does not exist.
Adding links
{{item
↓
Script error: The function "lookup_item_id_by_name_and_amount" 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_and_amount" 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 |
Capitalize | capitalize cap | Makes the first letter in the label uppercase.
| Boolean | optional |