Template:Item/doc: Difference between revisions

From Space Station 14 Wiki
Aliser (talk | contribs)
reorder
Aliser (talk | contribs)
composition param docs
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Examples ==
== Examples ==
=== Basic ===
{{tji|item|lv}}
{{tji|item|lv}}


Line 5: Line 6:


{{item|lv}}
{{item|lv}}
=== For items without icons ===
{{Callout
|Info
|Not all items have their icons uploaded to the wiki. Such items will only have their label displayed.<br>
Used here is some abstract item without icon.}}
{{tji|item|foldable}}
{{gda}}
{{item|foldable}}
=== Specifying amount of items ===
{{tji|item|steel|25}}
{{gda}}
{{item|steel|25}}
More examples
{{collapse
|{{item|steel|-55}}
{{item|steel|0}}
{{item|steel|0.5}}
{{item|steel|1}}
{{item|steel|5}}
{{item|steel|9}}
{{item|steel|10}}
{{item|steel|11}}
{{item|steel|15}}
{{item|steel|19}}
{{item|steel|20}}
{{item|steel|21}}
{{item|steel|25}}
{{item|steel|30}}
{{item|steel|35}}
{{item|steel|999999}}
}}
=== Amount format ===
{{tji|item|steel|5000}} (no format)<br>
{{tji|item|steel|5000|format amount:1}} (format)
{{gda}}
{{item|steel|5000}} (no format)<br>
{{item|steel|5000|format amount=1}} (format)


=== Custom label ===
=== Custom label ===
Line 21: Line 86:


{{item|proto-kinetic accelerator|label=}}
{{item|proto-kinetic accelerator|label=}}
==== Capitalizing the label ====
This makes the first letter of the label uppercase.
{{tji|item|proto-kinetic accelerator|capitalize:1}} <br>
{{gray or}} <br>
{{tji|item|proto-kinetic accelerator|cap:1}}
{{gda}}
{{item|proto-kinetic accelerator|capitalize=1}} <br>
{{gray or}} <br>
{{item|proto-kinetic accelerator|cap=1}}
==== Capitalizing each word in the label ====
This makes the first letter in each word inside the label uppercase.
{{tji|item|proto-kinetic accelerator|capitalize all:1}} <br>
{{gray or}} <br>
{{tji|item|proto-kinetic accelerator|cap all:1}}
{{gda}}
{{item|proto-kinetic accelerator|capitalize all=1}} <br>
{{gray or}} <br>
{{item|proto-kinetic accelerator|cap all=1}}


=== Custom icon size ===
=== Custom icon size ===
Line 28: Line 120:


{{item|lv|size=64px}}
{{item|lv|size=64px}}
=== Adding links ===
{{tji|item|Deckard|link:Guns}}
{{gda}}
{{item|Deckard|link = Guns}}
{{Callout|Info|Some items have links by default, such as {{item|protolathe}}, so with this option you can override them as you wish.}}
=== Composition ===
Composition defines order of parts that compose an item label: icon, label and amount. Currently, these modes are available:
{| class="wikitable"
|+ Composition modes
|-
! Mode !! Usage !! Result
|-
| {{kbd|icon label [amount]}} (default) || {{tji|item|brass|25}} || {{item|brass|25}}
|-
| {{kbd|icon amount label}} || {{tji|item|brass|25|composition:icon amount label}} || {{item|brass|25|composition=icon amount label}}
|}


== A list of all items with icons ==
== A list of all items with icons ==
Contains all items with icons. Updates automatically.  
See [[Template:Item/doc/list of items with icons]].


{{#invoke: Item|generate_item_icons_for_all_items_with_icons|4}}
== A list of all items ==
See [[Template:Item/doc/list_of_items]].


== Errors ==
== Errors ==
=== Unknown item with name ===
=== Unknown item ===
{{tji|item|lorem ipsum honk}}
{{tji|item|lorem ipsum honk}}


Line 41: Line 155:


{{item|lorem ipsum honk}}
{{item|lorem ipsum honk}}
=== No image defined for item with name ===
{{tji|item|foldable}}
{{gda}}
{{item|foldable}}
<noinclude>[[Category:Template documentation]]</noinclude>

Latest revision as of 15:18, 26 May 2025

Examples

Basic

{{item|lv}}

LV cable coil

For items without icons

Info
Not all items have their icons uploaded to the wiki. Such items will only have their label displayed.
Used here is some abstract item without icon.

{{item|foldable}}

foldable

Specifying amount of items

{{item|steel|25}}

steel [25]

More examples

Amount format

{{item|steel|5000}} (no format)
{{item|steel|5000|format amount=1}} (format)

steel [5000] (no format)
steel [5,000] (format)

Custom label

{{item|proto-kinetic accelerator|label=hole-maker}}

hole-maker

Empty label

To remove the label alltogether, pass an empty string to label.

{{item|proto-kinetic accelerator|label=}}

Capitalizing the label

This makes the first letter of the label uppercase.

{{item|proto-kinetic accelerator|capitalize=1}}
or
{{item|proto-kinetic accelerator|cap=1}}

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|proto-kinetic accelerator|capitalize all=1}}
or
{{item|proto-kinetic accelerator|cap all=1}}

Proto-kinetic Accelerator
or
Proto-kinetic Accelerator

Custom icon size

{{item|lv|size=64px}}

LV cable coil

Adding links

{{item|Deckard|link=Guns}}

Deckard

Info
Some items have links by default, such as protolathe, so with this option you can override them as you wish.

Composition

Composition defines order of parts that compose an item label: icon, label and amount. Currently, these modes are available:

Composition modes
Mode Usage Result
icon label [amount] (default) {{item|brass|25}} brass [25]
icon amount label {{item|brass|25|composition=icon amount label}} 25 brass

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|lorem ipsum honk}}

unknown item 'lorem ipsum honk'