imported>RheingoldRiver
Adding default set of pages
 
the mass documenting
 
Line 1: Line 1:
== Summary ==
'''<code>Item icon</code> shows a small item icon next to a link to that item's page — a thin wrapper around {{tl|Link icon}} with the type fixed to "Item".'''
<templatedata>
__TOC__
{
"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 ==
== Overview ==
For the examples below, <code><nowiki>File:Mystic Feather (Item).png</nowiki></code> was used as the icon for a page called <code>Mystic Feather</code>.
This template is shorthand for <code>{{Link icon|...|type=Item}}</code>. It renders the icon image <code>&lt;Name&gt; (Item).png</code> followed by a link to the page of that name. If the icon file does not exist it falls back to a small <code>?</code> placeholder. Pass <code>notext</code> to show only the icon with no text label. '''Note: this template is not currently used on any live page''' — it is documented here for completeness.
 
== Parameters ==
{| class="wikitable"
{| class="wikitable"
! Code !! Result
! Parameter !! Required? !! What it does !! Example
|-
| <code><nowiki>{{Item icon|Mystic Feather}}</nowiki></code> || {{Item icon|Mystic Feather}}
|-
| <code><nowiki>{{Item icon|Mystic Feather|Mystic Feathers}}</nowiki></code> || {{Item icon|Mystic Feather|Mystic Feathers}}
|-
|-
| <code><nowiki>{{Item icon|Mystic Feather|notext}}</nowiki></code> || {{Item icon|Mystic Feather|notext}}
| <code>1</code> (first unnamed) || Required || The item page name. Used both as the link target and to build the icon file name <code>&lt;name&gt; (Item).png</code>. || <code>Magnificat</code>
|-
|-
| <code><nowiki>{{Item icon|Missing Item}}</nowiki></code> (Missing Page Icon) || {{Item icon|Missing Item}}
| <code>2</code> (second unnamed) || Optional || Display text for the link. If omitted, the page name (param 1) is shown. The special value <code>notext</code> hides the text and shows only the icon. || <code>the Magnificat sceptre</code>
|}
|}
== Dependencies==
 
For this template to work properly, you need the following:
== How to use ==
* The base {{tl|Link icon}} template.
1. Write <code>{{Item icon|PageName}}</code> to get the item's icon plus a link reading "PageName".
* The <code>.link-icon</code> class and any related classes, found in [[MediaWiki:Common.css]].
2. To show different link text, add it as the second value: <code>{{Item icon|Magnificat|the Magnificat sceptre}}</code>.
3. To show the icon alone (no text), use the literal second value <code>notext</code>: <code>{{Item icon|Magnificat|notext}}</code>.
4. The icon image must be uploaded as <code>&lt;PageName&gt; (Item).png</code> (note the space and parentheses). If it is missing, a small <code>?</code> placeholder shows instead, so the link still works.
 
== Copy this ==
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Item icon|PageName|display text}}
</syntaxhighlight>
 
== Example ==
{{Item icon|Magnificat|the Magnificat sceptre}}
 
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Item icon|Magnificat|the Magnificat sceptre}}
</syntaxhighlight>
 
== Tips & notes ==
* Currently unused on live pages; the example is illustrative.
* The icon file naming rule is strict: <code>&lt;Name&gt; (Item).png</code>, with a literal space before <code>(Item)</code>. A missing file degrades gracefully to a <code>?</code>. (This is a different scheme from the item-page image convention <code>Ut-&lt;Name&gt;.png</code> / <code>T#&lt;Type&gt;.png</code> used inside {{tl|ItemInfobox}}.)
* The text-and-icon link points to the page named in param 1; with <code>notext</code> the icon itself links there.
* This wrapper just sets <code>type=Item</code> on {{tl|Link icon}}; its sibling {{tl|Character icon}} does the same with <code>type=Character</code>.
* Depends on the <code>.link-icon</code> CSS classes in [[MediaWiki:Common.css]].

Latest revision as of 11:55, 20 June 2026

Item icon shows a small item icon next to a link to that item's page — a thin wrapper around {{Link icon}} with the type fixed to "Item".

Overview

This template is shorthand for ? .... It renders the icon image <Name> (Item).png followed by a link to the page of that name. If the icon file does not exist it falls back to a small ? placeholder. Pass notext to show only the icon with no text label. Note: this template is not currently used on any live page — it is documented here for completeness.

Parameters

Parameter Required? What it does Example
1 (first unnamed) Required The item page name. Used both as the link target and to build the icon file name <name> (Item).png. Magnificat
2 (second unnamed) Optional Display text for the link. If omitted, the page name (param 1) is shown. The special value notext hides the text and shows only the icon. the Magnificat sceptre

How to use

1. Write ? PageName to get the item's icon plus a link reading "PageName". 2. To show different link text, add it as the second value: ? the Magnificat sceptre. 3. To show the icon alone (no text), use the literal second value notext: ?. 4. The icon image must be uploaded as <PageName> (Item).png (note the space and parentheses). If it is missing, a small ? placeholder shows instead, so the link still works.

Copy this

{{Item icon|PageName|display text}}

Example

? the Magnificat sceptre

{{Item icon|Magnificat|the Magnificat sceptre}}

Tips & notes

  • Currently unused on live pages; the example is illustrative.
  • The icon file naming rule is strict: <Name> (Item).png, with a literal space before (Item). A missing file degrades gracefully to a ?. (This is a different scheme from the item-page image convention Ut-<Name>.png / T#<Type>.png used inside {{ItemInfobox}}.)
  • The text-and-icon link points to the page named in param 1; with notext the icon itself links there.
  • This wrapper just sets type=Item on {{Link icon}}; its sibling {{Character icon}} does the same with type=Character.
  • Depends on the .link-icon CSS classes in MediaWiki:Common.css.