Template:Item icon: Difference between revisions

Jump to navigation Jump to search
Factor documentation out
(Overhaul examples)
(Factor documentation out)
Line 11: Line 11:
}} <span class="bg3wiki-itemicon-link" style="margin-left: {{#lvar:margin}}rem;">{{#if:{{{show_name|}}}|[[{{{name}}}]] }}</span></span></onlyinclude></includeonly><noinclude>
}} <span class="bg3wiki-itemicon-link" style="margin-left: {{#lvar:margin}}rem;">{{#if:{{{show_name|}}}|[[{{{name}}}]] }}</span></span></onlyinclude></includeonly><noinclude>


This template fetches and displays an icon for an item. The information is uploaded using the standard item descriptions. Use [[Template:ItemIcon Insert]] to add a page that doesn't use [[Template:MiscItemPage]], [[Template:EquipmentPage]], or [[Template:WeaponPage]].
{{/doc}}
 
See [[/Family]] for information on the various ItemIcon templates.
 
Usage: <pre>{{ItemIcon
|name=the name of the icon page
|size=(optional) the size of the icon
|show_name=(optional) Whether to show the name. Any value will show the name of the item as a link. Omit to hide it.
|show_rarity=(optional) Whether to add a border and background to the icon according to the item's rarity. Omit to not show it.
}}</pre>
 
== Templates ==
 
Copy-ready template (no item name): <code><nowiki>{{ItemIcon|name=}}</nowiki></code>
 
Copy-ready template (with item name): <code><nowiki>{{ItemIcon|name=|show_name=true}}</nowiki></code>
 
=== Examples ===
<table class="wikitable">
<tr><th>Result</th><th>Name</th><th>Size</th><th>Show name?</th><th>Rarity?</th><th>Code</th></tr>
<!-- just the icon -->
{{/Example|Potion of Healing|40|false|false}}
{{/Example|Potion of Healing|25|false|false}}
{{/Example|Potion of Supreme Healing|40|false|false}}
{{/Example|Potion of Supreme Healing|25|false|false}}
{{/Example|The Red Knight's Final Stratagem|40|false|false}}
{{/Example|The Red Knight's Final Stratagem|25|false|false}}
<!-- icon and link -->
{{/Example|Potion of Healing|40|true|false}}
{{/Example|Potion of Healing|25|true|false}}
{{/Example|Potion of Supreme Healing|40|true|false}}
{{/Example|Potion of Supreme Healing|25|true|false}}
{{/Example|The Red Knight's Final Stratagem|40|true|false}}
{{/Example|The Red Knight's Final Stratagem|25|true|false}}
 
<!-- rarity and link -->
{{/Example|Potion of Healing|40|true|true}}
{{/Example|Potion of Healing|25|true|true}}
{{/Example|Potion of Supreme Healing|40|true|true}}
{{/Example|Potion of Supreme Healing|25|true|true}}
{{/Example|The Red Knight's Final Stratagem|40|true|true}}
{{/Example|The Red Knight's Final Stratagem|25|true|true}}
</table>


<!-- Cargo table definition -->
<!-- Cargo table definition -->

Navigation menu