Template:Item: Difference between revisions
amount now allows for arbitrary strings |
added placement param to customize the rendering. currently non-functional. |
||
Line 78: | Line 78: | ||
"description": "An class to add to the item element.", | "description": "An class to add to the item element.", | ||
"type": "string", | "type": "string", | ||
"suggested": true | |||
}, | |||
"placement": { | |||
"label": "Placement pattern", | |||
"description": "How elements of the template should be placed together? '!' is icon, '@' is label, '#' is amount. It can be doubled to create an \"if\" section, meaning if that designator is missing, the whole section is discarded.", | |||
"type": "line", | |||
"default": "!@## [#]##", | |||
"suggested": true | "suggested": true | ||
} | } | ||
Line 90: | Line 97: | ||
"capitalize all", | "capitalize all", | ||
"link", | "link", | ||
"class" | "class", | ||
"placement" | |||
], | ], | ||
"description": "Produces an in-game item icon with a label. The label is the name of that item. Items without icons... will not have icons. See extra parameters for extra spice!" | "description": "Produces an in-game item icon with a label. The label is the name of that item. Items without icons... will not have icons. See extra parameters for extra spice!" |
Revision as of 07:28, 21 May 2025
Examples
Basic
{{item
↓
For items without icons
Used here is some abstract item without icon.
{{item
↓
foldable
Specifying amount of items
{{item
↓
More examples
Amount format
{{item
{{item
↓
steel [5000] (no format)
steel [5,000] (format)
Custom label
{{item
↓
Empty label
To remove the label alltogether, pass an empty string to label
.
{{item
↓
Capitalizing the label
This makes the first letter of the label uppercase.
{{item
or
{{item
↓
Proto-kinetic accelerator
or
Proto-kinetic accelerator
Capitalizing each word in the label
This makes the first letter in each word inside the label uppercase.
{{item
or
{{item
↓
Proto-kinetic Accelerator
or
Proto-kinetic Accelerator
Custom icon size
{{item
↓
Adding links
{{item
↓

Composition
Composition defines order of parts that compose an item label: icon, label and amount. Currently, these modes are available:
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
↓
unknown item 'lorem ipsum honk'Produces an in-game item icon with a label. The label is the name of that item. Items without icons... will not have icons. See extra parameters for extra spice!
Parameter | Description | Type | Status | |
---|---|---|---|---|
Item | 1 | What item are you looking for? ID, name or a custom alias? Use whatever you wish! Any casing is allowed, including lowercase.
| Line | required |
Amount | 2 | Amount of item. By default has no amount. Arbitrary strings are allowed, though this disables and formatting and special lookups.
| Number | suggested |
Format amount | format amount | Whether to format the amount (eg adding commas).
| Boolean | 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 | suggested |
Capitalize all | capitalize all cap all | Makes the first letter in every word inside the label uppercase.
| Boolean | suggested |
Link | link | A link to give to the item. By default, a link is added if it's defined in the config - read more in Module:Item. | Page name | suggested |
Class | class | An class to add to the item element. | String | suggested |
Placement pattern | placement | How elements of the template should be placed together? '!' is icon, '@' is label, '#' is amount. It can be doubled to create an "if" section, meaning if that designator is missing, the whole section is discarded.
| Line | suggested |