Template:Item: Difference between revisions

From Space Station 14 Wiki
(moved from {{item icon}})
 
(added support for empty labels)
Line 12: Line 12:
     -->{{#iferror: {{#var:item_icon_file}}
     -->{{#iferror: {{#var:item_icon_file}}
         |{{#var:item_icon_file}}
         |{{#var:item_icon_file}}
         |{{#vardefine: item_label|{{#invoke: Item|lookup_item_name_by_id|{{#var:item_id}}}}<!--/vardefine-->}}<!--
         |{{#vardefine: item_label|{{{label|{{{l|{{#invoke: Item|lookup_item_name_by_id|{{#var:item_id}}<!--/invoke-->}}<!--/l-->}}}<!--/label-->}}}<!--/vardefine-->}}<!--


--><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><!--
--><span class="item-label">'''{{{label|{{{l|{{#var:item_label}}}}}<!--/label-->}}}'''</span><!--
-->{{#if: {{#var:item_label}}<!--
                -->|<span class="item-label">'''{{{label|{{{l|{{#var:item_label}}}}}<!--/label-->}}}'''</span><!--
            -->}}<!--
--></span>
--></span>
     }}
     }}

Revision as of 12:35, 17 August 2024

Template documentation
view or edit this documentation about template documentation
Uses Lua module
This template uses Lua module:
Uses template styles
This template uses template styles found in:

Examples

Basic

{{item|lv}}

Script error: The function "lookup_item_id_by_name" does not exist.

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}}

Script error: The function "lookup_item_id_by_name" does not exist.

Specifying amount of items

{{item|steel|25}}

Script error: The function "lookup_item_id_by_name" does not exist.

More examples

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Script error: The function "lookup_item_id_by_name" does not exist.

Custom label

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

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|proto-kinetic accelerator|label=}}

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

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|lv|size=64px}}

Script error: The function "lookup_item_id_by_name" does not exist.

Adding links

{{item|Deckard|link=Guns}}

Script error: The function "lookup_item_id_by_name" does not exist.

Info
Some items have links by default, such as Script error: The function "lookup_item_id_by_name" does not exist., so with this option you can override them as you wish.

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}}

Script error: The function "lookup_item_id_by_name" does not exist.

No description.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Item1

What item are you looking for? Any casing is allowed, including lowercase.

Example
lv coil
Linerequired
Sizesize

Icon size

Default
24px
Linesuggested
Labellabel l

Label override.

Linesuggested