Template:Item icon/doc: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Summary == <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 t...") |
|||
| Line 29: | Line 29: | ||
== Examples == | == Examples == | ||
For the examples below, <code><nowiki>File: | For the examples below, <code><nowiki>File:12440_Steel_Bar.png</nowiki></code> was used as the icon for a page called <code>Steel Bar</code>. | ||
{| class="wikitable" | {| class="wikitable" | ||
! Code !! Result | ! Code !! Result | ||
|- | |- | ||
| <code><nowiki>{{Item icon| | | <code><nowiki>{{Item icon|Steel Bar}}</nowiki></code> || {{Item icon|Steel Bar}} | ||
|- | |- | ||
| <code><nowiki>{{Item icon| | | <code><nowiki>{{Item icon|Steel Bar|Steel Bar}}</nowiki></code> || {{Item icon|Steel Bar|Steel Bar}} | ||
|- | |- | ||
| <code><nowiki>{{Item icon| | | <code><nowiki>{{Item icon|Steel Bar|notext}}</nowiki></code> || {{Item icon|Steel Bar|notext}} | ||
|- | |- | ||
| <code><nowiki>{{Item icon|Missing Item}}</nowiki></code> (Missing Page Icon) || {{Item icon|Missing Item}} | | <code><nowiki>{{Item icon|Missing Item}}</nowiki></code> (Missing Page Icon) || {{Item icon|Missing Item}} | ||
|} | |} | ||
== Dependencies== | == Dependencies== | ||
For this template to work properly, you need the following: | For this template to work properly, you need the following: | ||
* The base {{tl|Link icon}} template. | * The base {{tl|Link icon}} template. | ||
* The <code>.link-icon</code> class and any related classes, found in [[MediaWiki:Common.css]]. | * The <code>.link-icon</code> class and any related classes, found in [[MediaWiki:Common.css]]. | ||
Latest revision as of 05:02, 3 March 2025
Summary[edit source]
Use this template to display an icon next to a page link. This template assumes that each page has an icon uploaded at a specific location, namely "File:Page Name (Item).png".
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Page Name | 1 page | The name for the target page.
| Page name | required |
| Link Label | 2 label | The text to the be displayed on the link icon's label.
| Line | optional |
Examples[edit source]
For the examples below, File:12440_Steel_Bar.png was used as the icon for a page called Steel Bar.
| Code | Result |
|---|---|
{{Item icon|Steel Bar}} |
Steel Bar}}{{#vardefine:display|Steel Bar}}{{#vardefine:iconSize|1.2em}}{{#vardefine:lineHeight|1lh}}{{#vardefine:fileExists|}} |
{{Item icon|Steel Bar|Steel Bar}} |
Steel Bar}}{{#vardefine:display|Steel Bar}}{{#vardefine:iconSize|1.2em}}{{#vardefine:lineHeight|1lh}}{{#vardefine:fileExists|}} |
{{Item icon|Steel Bar|notext}} |
Steel Bar}}{{#vardefine:display|notext}}{{#vardefine:iconSize|1.2em}}{{#vardefine:lineHeight|1lh}}{{#vardefine:fileExists|}} |
{{Item icon|Missing Item}} (Missing Page Icon) |
Missing Item}}{{#vardefine:display|Missing Item}}{{#vardefine:iconSize|1.2em}}{{#vardefine:lineHeight|1lh}}{{#vardefine:fileExists|}} |
Dependencies[edit source]
For this template to work properly, you need the following:
- The base {{Link icon}} template.
- The
.link-iconclass and any related classes, found in MediaWiki:Common.css.