Anonymous

Template:ItemIcon: Difference between revisions

From Melvor Idle
Added override to allow changing of link.
(Added a non-linebreaking space to prevent icon and link from being split up)
(Added override to allow changing of link.)
Line 1: Line 1:
A template for quickly building item links with icons. For example, <nowiki>{{ItemIcon|Compost}}</nowiki> becomes {{ItemIcon|Compost}}
A template for quickly building item links with icons. For example, <nowiki>{{ItemIcon|Compost}}</nowiki> becomes {{ItemIcon|Compost}}.


Adding a second argument allows you to override the text. For example, <nowiki>{{ItemIcon|Generous Harvest Potion I|Generous Harvest Potion}}</nowiki> gives {{ItemIcon|Generous Harvest Potion I|Generous Harvest Potion}}


<onlyinclude>[[File:{{{1}}} (item).svg|25px|link={{{1}}}]]&nbsp;[[{{{1}}}]]</onlyinclude>
 
<onlyinclude>{{#if:{{{2|}}}|[[File:{{{1}}} (item).svg|25px|link={{{1}}}]]&nbsp;[[{{{1}}}|{{{2}}}]]|[[File:{{{1}}} (item).svg|25px|link={{{1}}}]]&nbsp;[[{{{1}}}]]}}</onlyinclude>