Template:StackItem

From TheKolWiki
Revision as of 17:27, 20 May 2015 by Fig bucket (Talk | contribs) (add a key field to help with sorting these in a table)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
{{StackItem}}
{{#if:{{{key|}}}|<span style="display:none;">{{#ifeq:{{{key}}}|name|{{Data|{{{1|}}}|name|{{{1}}}}}|{{{key}}}}}</span>}}{{#if:{{{1|}}}|[[File:{{Data|{{{1}}}|image|nopic2.gif}}|link={{{1}}}]]<br />[[{{{1}}}|{{{2|{{Data|{{{1}}}|name|{{{1}}}(?)}}}}}]]|[[File:confused.gif|link=]]<br />something...}}

This template puts a clickable item image above a link to that item, for use in centered text such as table cells and recipes. The template requires only the name of the item's page - the item's actual name (if it contains special characters) and image are fetched from the item's data page. Compare with Template:InlineItem.

Also works with clan trophies, effects, familiars, and skills.

Usage

{{StackItem|lime}}

Lime.gif
lime

{{StackItem|lime|ultra lime}}

Lime.gif
ultra lime

{{StackItem}}

Confused.gif
something...

Notes

  • You can also specify key=k to include an invisible span beforehand containing text k, to act as a sort key when this is used in tables. The literal form key=name will use the item's name from its data page as the key.