Template:ItemLink

From Secrets of Grindea Wiki
Jump to navigation Jump to search
Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit Template:ItemLink/doc to edit this documentation. (How does this work?)

ItemLink is used to create an [image + text] element that, when clicked on, sends the user to an article on the wiki.

Parameters

Parameter Notes
id ID of an item from Module:ItemStatsTwo/data (or, its brains, Module:Item)

Default Value: "" (empty)

If set (and valid), ID provided "name" and "sprite" will be used as default values for "image", "label", and "article". This means that you can provide an item (say, Power Core) for the link to generate quickly, but you can also override the default values as usual if needed.

image The image to be used as an icon

Default Value: "Placeholder.png" (or ID "sprite", if set)

wh Size of the icon of format [New Width]x[New Height]

Default Value: "x20"

Width can be specified as Val, where Val is a number. Height can be specified as xVal, where Val is a number. Width and height are thus combined as WxH, where W and H are numbers.

Note that the height actually specifies the max height allowed. Items shorter than this will not be resized.

article The article towards which a link will be created.

Default Value: "" (empty) (or ID "name", if set).

If article is provided but label is empty, label will use the article's value.

If article doesn't have a value, a link will not be generated.

label Text to be used for the link

Default value: "" (empty) or article's value (if not empty) (or ID "name", if set)

nolink If parameter is not empty, links will not generate.

Example usage

Template Result
{{ItemLink}}
Placeholder.png Unknown

Faulty (or missing) parameters will usually make the ItemLink output something like this.

{{ItemLink
|image=WoodenSword.png}}
WoodenSword.png Unknown
{{ItemLink
|image=WoodenSword.png
|label=Wooden Sword}}
WoodenSword.png Wooden Sword
{{ItemLink
|image=WoodenSword.png
|article=Wooden Sword}}
WoodenSword.png Wooden Sword

Since label is empty, it takes article's value instead

{{ItemLink
|image=WoodenSword.png
|article=Wooden Sword
|nolink=1}}
WoodenSword.png Wooden Sword

Doesn't create links

This property is more relevant for ID mode, where links are auto created

{{ItemLink
|image=WoodenSword.png
|article=Wooden Sword
|label=Sword of Wooden}}
WoodenSword.png Sword of Wooden

Has a different label

{{ItemLink
|image=WoodenSword.png
|article=Squire's Claymore
|label=Wooden Sword}}
WoodenSword.png Wooden Sword

Links to Squire Claymore instead

{{ItemLink
|image=WoodenSword.png
|wh=10x10
|article=Wooden Sword}}
WoodenSword.png Wooden Sword

Smaller icon

{{ItemLink
|id=woodensword}}
WoodenSword.png Wooden Sword

Uses id for label, image and article

{{ItemLink
|id=woodensword
|nolink=1}}
WoodenSword.png Wooden Sword

Doesn't create links

{{ItemLink
|id=woodensword
|article=Squire's Claymore}}
WoodenSword.png Wooden Sword

Links to Squire's Claymore instead

{{ItemLink
|id=woodensword
|label=Keksimus Maximus
|image=Placeholder.png}}
Placeholder.png Keksimus Maximus

ID provided values can still be overridden by the other parameters (in this case, the image "Placeholder.png" was used intentionally).

Note that the link still points to "Wooden Sword" in this case!