Difference between revisions of "Template:Item icon"
Jump to navigation
Jump to search
m |
|||
(26 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>< | <includeonly>{{#if: <!-- hiding linebreaks --> | ||
{{#vardefine:smw_context|{{#show:{{{1|}}}|?Has context}}}} | |||
{{#vardefine:smw_icon|{{#show:{{{1|}}}|?Has game icon|link=none|default=File:Item.png}}}} | |||
{{#vardefine:smw_name|{{{alt|{{#show:{{{1|}}}|?Has canonical name|default={{{1|Item}}}}}}}}}} | |||
}}{{#ifeq:{{#var:smw_context}}|Currency|[[File:{{#explode:{{#var:smw_icon}}|:|1}}|24px|link={{{1}}}]] [[{{{1}}}|{{#var:smw_name}}]]|{{{{#if:{{{hq|}}}|STFI HQ|STFI}}|icon={{#explode:{{#var:smw_icon}}|:|1}}|link={{{1|}}}|size={{{size|small}}}}}{{#ifeq:{{lc:{{{2|}}}}}|x|| [[{{{1|Item}}}|{{#if:{{{2|}}}|{{{2}}}|{{#var:smw_name}}}}]]}}}}</includeonly><noinclude> | |||
== Description == | == Description == | ||
<pre>{{item icon|<item name>}}</pre> | <pre>{{item icon|<item name>}}</pre> | ||
Displays a link to the item and | Displays a link to the item name (canonical name) and the item icon. | ||
=== Parameters === | === Parameters === | ||
; ''unnamed parameter'' 1 | ; ''unnamed parameter'' 1 | ||
: Item | : Item name. Defaults to "Item". | ||
; ''unnamed parameter'' 2 | ; ''unnamed parameter'' 2 | ||
: | : Link text. Defaults to [[Property:Has canonical name|canonical name]]. Assign ''x'' to prevent name from appearing. | ||
; | ; size | ||
: | : Optional. Either ''small'', ''mid'', or ''big''. Defaults to ''small''. | ||
; alt | |||
: | : Optional. Optional name to item. | ||
; hq | |||
: Optional. Displays a {{HQ}} [[high quality]] item. | |||
== Examples == | == Examples == | ||
* {{item icon| | * {{item icon|Raisins}} is produced from <code><nowiki>{{item icon|Raisins}}</nowiki></code> | ||
* {{item icon| | * {{item icon|Raisins|size=small}} is produced from <code><nowiki>{{item icon|Raisins|size=small}}</nowiki></code> | ||
* {{item icon| | * {{item icon|Raisins|size=mid}} is produced from <code><nowiki>{{item icon|Raisins|size=mid}}</nowiki></code> | ||
* {{item icon| | * {{item icon|Raisins|size=big}} is produced from <code><nowiki>{{item icon|Raisins|size=big}}</nowiki></code> | ||
* {{item icon|Raisins|x}} is produced from <code><nowiki>{{item icon|Raisins|x}}</nowiki></code> | |||
* {{item icon|Raisins|alt=Fruit}} is produced from <code><nowiki>{{item icon|Raisins|alt=Fruit}}</nowiki></code> | |||
* {{item icon|Raisins|hq=true}} is produced from <code><nowiki>{{item icon|Raisins|hq=true}}</nowiki></code> | |||
<pre>This is an example a paragraph with the {{item icon|Raisins}} item in it.</pre> | |||
This is an example a paragraph with the {{item icon|Raisins}} item in it. | |||
[[Category:Icon templates|Item icon]]</noinclude> | [[Category:Icon templates|Item icon]]</noinclude> |
Latest revision as of 22:40, 22 December 2023
Description
{{item icon|<item name>}}
Displays a link to the item name (canonical name) and the item icon.
Parameters
- unnamed parameter 1
- Item name. Defaults to "Item".
- unnamed parameter 2
- Link text. Defaults to canonical name. Assign x to prevent name from appearing.
- size
- Optional. Either small, mid, or big. Defaults to small.
- alt
- Optional. Optional name to item.
- hq
- Optional. Displays a high quality item.
Examples
- Raisins is produced from
{{item icon|Raisins}}
- Raisins is produced from
{{item icon|Raisins|size=small}}
- Raisins is produced from
{{item icon|Raisins|size=mid}}
- Raisins is produced from
{{item icon|Raisins|size=big}}
{{item icon|Raisins|x}}
is produced from - Fruit is produced from
{{item icon|Raisins|alt=Fruit}}
- Raisins is produced from
{{item icon|Raisins|hq=true}}
This is an example a paragraph with the {{item icon|Raisins}} item in it.
This is an example a paragraph with the Raisins item in it.