Jump to content

Template:Item icon/doc

From Factory Town 2 Wiki

Summary[edit]

<templatedata> { "params": { "1": { "aliases": [ "page" ], "label": "Page Name", "description": "The name for the target page.", "example": "Page Name", "type": "wiki-page-name", "required": true }, "2": { "aliases": [ "label" ], "label": "Link Label", "description": "The text to the be displayed on the link icon's label.", "example": "Alternative Page Name", "type": "line" } }, "description": "Use this template to display an icon next to a page link.\n\nThis template assumes that each page has an icon uploaded at a specific location, namely \"File:Page Name (Item).png\".", "format": "inline" } </templatedata>

Examples[edit]

For the examples below, File:Mystic Feather (Item).png was used as the icon for a page called Mystic Feather.

Code Result
{{Item icon|Mystic Feather}} Mystic Feather}}{{#vardefine:display|Mystic Feather}}{{#vardefine:iconSize|1.2em}}{{#vardefine:lineHeight|1lh}}{{#vardefine:fileExists|}}[[File:{{#var:target}} (Item).png|link={{#var:target}}|alt=]] [[{{#var:target}}|{{#var:display}}]]
{{Item icon|Mystic Feather|Mystic Feathers}} Mystic Feather}}{{#vardefine:display|Mystic Feathers}}{{#vardefine:iconSize|1.2em}}{{#vardefine:lineHeight|1lh}}{{#vardefine:fileExists|}}[[File:{{#var:target}} (Item).png|link={{#var:target}}|alt=]] [[{{#var:target}}|{{#var:display}}]]
{{Item icon|Mystic Feather|notext}} Mystic Feather}}{{#vardefine:display|notext}}{{#vardefine:iconSize|1.2em}}{{#vardefine:lineHeight|1lh}}{{#vardefine:fileExists|}}[[File:{{#var:target}} (Item).png|link={{#var:target}}|alt=]]
{{Item icon|Missing Item}} (Missing Page Icon) Missing Item}}{{#vardefine:display|Missing Item}}{{#vardefine:iconSize|1.2em}}{{#vardefine:lineHeight|1lh}}{{#vardefine:fileExists|}}[[File:{{#var:target}} (Item).png|link={{#var:target}}|alt=]] [[{{#var:target}}|{{#var:display}}]]

Dependencies[edit]

For this template to work properly, you need the following:

  • The base {{#invoke:Template link|main|code=on}} template.
  • The .link-icon class and any related classes, found in MediaWiki:Common.css.