Template:Icon: Difference between revisions

From Melvor Idle
m (Reference currency templates)
(Move documentation to subpage)
Tag: Replaced
Line 1: Line 1:
A generic version of the template used in things like [[Template:ItemIcon]] or [[Template:UpgradeIcon]].
<includeonly>{{#invoke:Icons|Icon|{{{1|}}}|{{{2|}}}|type={{{type|}}}|ext={{{ext|}}}|size={{#if:{{{size|}}}|{{{size}}}|{{#if:{{{menu|}}}|25|23}}}}|qty={{{qty|}}}|img={{{img|}}}|notext={{{notext|}}}|nolink={{{nolink|}}}|noicon={{{noicon|}}}|menu={{{menu|}}}}}</includeonly><noinclude>
 
{{/doc}}
You probably want to use one of the following instead for most things:
</noinclude>
 
* [[Template:ItemIcon]] for items
* [[Template:MonsterIcon]] for monsters
* [[Template:Skill]] for skill
* [[Template:UpgradeIcon]] for upgrades (like the {{UpgradeIcon|Dragon Pickaxe}})
* [[Template:PetIcon]] for pets
* [[Template:PrayerIcon]] for prayers
* [[Template:ZoneIcon]] for combat zones
* [[Template:GP]], [[Template:SC]], or [[Template:RC]] for formatting of currencies (gold pieces, slayer coins, and raid coins respectively)
 
For example: {{T|ItemIcon|Raw Trout}} becomes {{ItemIcon|Raw Trout}}.
 
Some icon categories/types do not have these shorthand templates, so instead the <code>type</code> parameter should be used: {{T|Icon|<IconName>|type=<IconType>}}. The types this applies to are as follows:
 
* <code>mark</code> for Summoning marks
* <code>spell</code> for standard and ancient magick spells
* <code>curse</code> for curse spells
* <code>aurora</code> for aurora spells
* <code>thieving</code> for Thieving NPCs
* <code>constellation</code> for Astrology constellations
 
Format is like so: {{T|Icon|type=combatArea|Castle of Kings|Knight Time}} becomes {{Icon|type=combatArea|Castle of Kings|Knight Time}}.
 
You can also just do {{T|Icon|Combat}} {{Icon|Combat}} if you need an icon for an image that doesn't belong to a given category.
 
For Herblore potions, the generic potion page can be linked to by specifying the potion name without a tier, for example: {{T|Icon|Diamond Luck Potion}} becomes {{Icon|Diamond Luck Potion}}.
 
Some special overrides exist:
{| class="wikitable sortable"
! Input !! Output
|-
|{{T|Icon|Melee}} || {{Icon|Melee}}
|-
|{{T|Icon|Item Alchemy}} || {{Icon|Item Alchemy}}
|-
|{{T|Icon|Superheat}} || {{Icon|Superheat}}
|-
|{{T|Icon|Basic Resupply}} || {{Icon|Basic Resupply}}
|-
|{{T|Icon|Standard Resupply}} || {{Icon|Standard Resupply}}
|-
|{{T|Icon|Generous Resupply}} || {{Icon|Generous Resupply}}
|-
|{{T|Icon|type=monster|Golbin}}||{{Icon|type=monster|Golbin}}
|-
|{{T|Icon|type=monster|Spider (lv. 51)}}||{{MonsterIcon|Spider (lv. 51)}}
|-
|{{T|Icon|type=monster|Spider2}}||{{MonsterIcon|Spider2}}
|-
|{{T|Icon|type=skill|Alt. Magic}}||{{Icon|type=skill|Alt. Magic}}
|}
 
Other options:
{| class="wikitable sortable stickyHeader"
|- class="headerRow-0"
! rowspan="2" | Option !! rowspan="2" | Description !! colspan="2" | Example
|- class="headerRow-1"
! Input !! style="min-width:200px" | Output
|-
| <code>type</code> || Specifies the icon type || {{T|Icon|Normal Log|type=item}} || {{Icon|Normal Logs|type=item}}
|-
| <code>ext</code> || Specifies the image's extension. This should almost always be automatically determined, therefore if this option is required for the correct image to display then there is likely an issue with extension overrides within [[Module:Icons]] || {{T|Icon|Golbin|type=monster|ext=svg}} || {{Icon|Golbin|type=monster|ext=svg}}
|-
| <code>size</code> || Determines the height (in pixels) of the image. If not specified the default is 25px (or 23px if the <code>menu</code> option is used) || {{T|Icon|Combat|size=50}} || {{Icon|Combat|size=50}}
|-
| <code>qty</code> || Specifies the number of item to go alongside the icon and text || {{T|Icon|type=item|Elder Dragonhide|qty=5000}} || {{Icon|type=item|Elder Dragonhide|qty=5000}}
|-
| <code>img</code> || If specified, this determines which image is used, in which case the first parameter only determines the link rather than the link and image || {{T|Icon|Mining|img=Cool Rock|type=pet}} || {{Icon|Mining|img=Cool Rock|type=pet}}
|-
| <code>notext</code> || If specified, only the image (with link) is generated || {{T|Icon|Mastery|notext=true}} || {{Icon|Mastery|notext=true}}
|-
| <code>nolink</code> || If specified, the text is generated without a link || {{T|Icon|Mastery|nolink=true}} || {{Icon|Mastery|nolink=true}}
|-
| <code>noicon</code> || If specified, only the text (with link) is generated. This has limited use here, and was originally intended for use in Lua modules to allow for ease of disambiguating links || {{T|Icon|Cyclops|type=thieving|noicon=true}} || {{Icon|Cyclops|type=thieving|noicon=true}}
|-
| <code>menu</code> || Formats the icon in a handy table (useful for menuboxes) || {{T|Icon|Combat|menu=true}} || {{Icon|Combat|menu=true}}
|}
 
<!-- Testing: Ambiguous pages
{{Icon|Golbin|type=monster}}
{{Icon|Golbin|type=thieving}}
{{Icon|Chick|type=pet}}
{{Icon|Chick|type=monster}}
{{Icon|Chicken|type=item}}
{{Icon|Chicken|type=monster}}
{{Icon|Cyclops|type=thieving}}
{{Icon|Cyclops|type=item}}
{{Icon|Cyclops|type=mark}}
{{Icon|Wizard|type=monster}}
{{Icon|Wizard|type=thieving}}
-->
<includeonly><onlyinclude>{{#invoke:Icons|Icon|{{{1|}}}|{{{2|}}}|type={{{type|}}}|ext={{{ext|}}}|size={{#if:{{{size|}}}|{{{size}}}|{{#if:{{{menu|}}}|25|23}}}}|qty={{{qty|}}}|img={{{img|}}}|notext={{{notext|}}}|nolink={{{nolink|}}}|noicon={{{noicon|}}}|menu={{{menu|}}}}}</onlyinclude></includeonly>

Revision as of 23:01, 17 April 2022

A generic version of the template used in things like Template:ItemIcon or Template:UpgradeIcon.

You probably want to use one of the following instead for most things:

For example: {{ItemIcon|Raw Trout}} becomes Raw Trout.

Some icon categories/types do not have these shorthand templates, so instead the type parameter should be used: {{Icon|<IconName>|type=<IconType>}}. The types this applies to are as follows:

  • mark for Summoning marks
  • thieving for Thieving NPCs

Format is like so: {{Icon|Castle of Kings|Knight Time|type=combatArea}} becomes

Error creating thumbnail: File missing
Knight Time

. You can also just do {{Icon|Combat}}

Error creating thumbnail: File missing
Combat

if you need an icon for an image that doesn't belong to a given category.

For Herblore potions, the generic potion page can be linked to by specifying the potion name without a tier, for example: {{Icon|Diamond Luck Potion}} becomes Diamond Luck Potion.

Some special overrides exist:

Input Output
{{Icon|Melee}}
Error creating thumbnail: File missing
Melee
{{Icon|Item Alchemy}}
Error creating thumbnail: File missing
Item Alchemy
{{Icon|Superheat}}
Error creating thumbnail: File missing
Superheat
{{Icon|Basic Resupply}} Basic Resupply
{{Icon|Standard Resupply}} Standard Resupply
{{Icon|Generous Resupply}} Generous Resupply
{{Icon|Golbin|type=monster}} Golbin
{{Icon|Alt. Magic|type=skill}}
Error creating thumbnail: File missing
Alt. Magic
{{Icon|Earth Golem (AoD)|type=monster}}
Error creating thumbnail: File missing
Earth Golem

Other options: