Template:Icon: Difference between revisions
From Melvor Idle
Falterfire (talk | contribs) (Did some shenanigans to allow for Icon calls on Melee) |
Falterfire (talk | contribs) (Added 'menu' option for infoboxes.) |
||
Line 14: | Line 14: | ||
You can also just do <nowiki>{{Icon|Combat}}</nowiki> {{Icon|Combat}} if you need an icon for an image that doesn't belong to a given category. | You can also just do <nowiki>{{Icon|Combat}}</nowiki> {{Icon|Combat}} if you need an icon for an image that doesn't belong to a given category. | ||
Some special overrides exist: | Some special overrides exist: | ||
Line 22: | Line 21: | ||
|<nowiki>{{Icon|Melee}}</nowiki> || {{Icon|Melee}} | |<nowiki>{{Icon|Melee}}</nowiki> || {{Icon|Melee}} | ||
|} | |} | ||
Other options: | |||
The 'notext' option sends only the image (with link), so <nowiki>{{Icon|Mastery|notext=true}}</nowiki> becomes {{Icon|Mastery|notext=true}} | |||
The 'menu' option formats the icon in a handy table (useful for menuboxes) so <nowiki>{{Icon|Combat|menu=true}}</nowiki> becomes {{Icon|Combat|menu=true}} | |||
<includeonly><onlyinclude><!-- | <includeonly><onlyinclude><!-- | ||
Line 33: | Line 39: | ||
Done to allow for easily fitting into combat triangle related tables | Done to allow for easily fitting into combat triangle related tables | ||
-->{{#ifeq:{{#var:link}}|Melee|{{#vardefine:image|Combat}}{{#vardefine:link|Attack}}}}<!-- | -->{{#ifeq:{{#var:link}}|Melee|{{#vardefine:image|Combat}}{{#vardefine:link|Attack}}}}<!-- | ||
-->[[File:{{#var:image}}{{#if:{{#var:type}}|_({{#var:type}})|}}.{{{ext|svg}}}|25px|link={{#var:link}}]]{{#if:{{{notext|}}}|| [[{{#var:link}}|{{#var:text}}]]}}</onlyinclude></includonly> | Handling for 'menu' option | ||
-->{{#if:{{{menu|}}}|{{{!}} class="articletable" style="display:inline-block; vertical-align:bottom;" | |||
{{!}}- | |||
{{!}}|}}<!-- | |||
-->[[File:{{#var:image}}{{#if:{{#var:type}}|_({{#var:type}})|}}.{{{ext|svg}}}|25px|link={{#var:link}}]]{{#if:{{{notext|}}}|| [[{{#var:link}}|{{#var:text}}]]}}<!-- | |||
-->{{#if:{{{menu|}}}|<br/> | |||
{{!}}}|}}</onlyinclude></includonly> |
Revision as of 19:56, 2 September 2020
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:
- Template:ItemIcon for items
- Template:MonsterIcon for monsters
- Template:Skill for skill
- Template:UpgradeIcon for upgrades (like the File:Dragon Pickaxe (upgrade). Dragon Pickaxe)
- Template:PetIcon for pets
- Template:PrayerIcon for prayers
Format is like so: {{Icon|type=combatArea|Castle of Kings|Knight Time}} becomes Knight Time.
You can also just do {{Icon|Combat}} Combat if you need an icon for an image that doesn't belong to a given category.
Some special overrides exist:
Input | Output |
---|---|
{{Icon|Melee}} | Melee |
Other options:
The 'notext' option sends only the image (with link), so {{Icon|Mastery|notext=true}} becomes
The 'menu' option formats the icon in a handy table (useful for menuboxes) so {{Icon|Combat|menu=true}} becomes
Combat |