Jump to content

Template:Character icon/doc

From Factory Town 2 Wiki
Revision as of 05:55, 10 July 2026 by imported>ARTIFICER (Importing default loadout)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 (Character).png\".", "format": "inline" } </templatedata>

Examples

[edit]

For the examples below, File:Invisible Boy (Character).png was used as the icon for a page called Invisible Boy.

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

Dependencies

[edit]

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

  • The base Script error: No such module "Template link". template.
  • The .link-icon class and any related classes, found in MediaWiki:Common.css.