Template:InlineItem: Difference between revisions

From A KoL Wiki
imported>Quietust
may as well update this one too
imported>Philmasterplus
Add 'key' parameter, copied from Template:StackItem
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}|{{click|image={{Data1|{{{1}}}|image|nopic2.gif}}|link={{{1}}}}} [[{{{1}}}|{{{2|{{Data1|{{{1}}}|name|{{{1}}}(?)}}}}}]]|{{click|image=confused.gif}} something...}}</includeonly>
<includeonly>{{#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}}}]] [[{{{1}}}|{{{2|{{Data|{{{1}}}|name|{{{1}}}(?)}}}}}]]|[[File:confused.gif|link=]] something...}}</includeonly><noinclude>__NOTOC__
<noinclude>__NOTOC__
{{Code2}}
{{Code2}}


This template puts a clickable item (or effect) image next to a link to that item (or effect), for use in running text or simple lists. The template requires only the item (or effect) name to select the image from the item (or effect) data page. Compare with [[:Template:StackItem]].
This template puts a clickable item image next to a link to that item, for use in running text or simple lists. 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:StackItem]].
 
Also works with clan trophies, effects, familiars, and skills.


==Usage==
==Usage==
Line 14: Line 15:
<pre>{{InlineItem}}</pre>
<pre>{{InlineItem}}</pre>
{{InlineItem}}
{{InlineItem}}
==Notes==
*You can also specify <code>key=k</code> to include an invisible span beforehand containing text <code>k</code>, to act as a sort key when this is used in tables.  The literal form <code>key=name</code> will use the item's name from its data page as the key.


[[Category:Standardization Templates|{{PAGENAME}}]]</noinclude>
[[Category:Standardization Templates|{{PAGENAME}}]]</noinclude>

Latest revision as of 16:01, 27 December 2020

{{#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}}}]] [[{{{1}}}|{{{2|{{Data|{{{1}}}|name|{{{1}}}(?)}}}}}]]|[[File:confused.gif|link=]] something...}}

This template puts a clickable item image next to a link to that item, for use in running text or simple lists. 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:StackItem.

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

Usage

{{InlineItem|lime}}

lime

{{InlineItem|lime|ultra lime}}

ultra lime

{{InlineItem}}

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.