6,366
editsAd placeholder
Template:Item icon: Difference between revisions
Jump to navigation
Jump to search
Overhaul examples
(Add rarity support) |
(Overhaul examples) |
||
Line 1: | Line 1: | ||
<includeonly><onlyinclude>{{#cargo_query: | <includeonly><onlyinclude>{{#lvardef:margin|{{#expr:0.01 * {{{size|40}}} }} }}<span class="bg3wiki-itemicon-wrapper" style="margin: auto {{#lvar:margin}}rem">{{#cargo_query: | ||
tables=item_icon | tables=item_icon | ||
|fields=TRIM(icon),CONCAT('', '{{{size|40}}}'),rarity,CONCAT('', '{{{show_rarity|}}}') | |fields=TRIM(icon),CONCAT('', '{{{size|40}}}'),rarity,CONCAT('', '{{{show_rarity|}}}') | ||
Line 9: | Line 9: | ||
|format=template | |format=template | ||
|template=ItemIcon Internal | |template=ItemIcon Internal | ||
}} {{#if:{{{show_name|}}}|[[{{{name}}}]] }}</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]]. | 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]]. | ||
Line 28: | Line 28: | ||
Copy-ready template (with item name): <code><nowiki>{{ItemIcon|name=|show_name=true}}</nowiki></code> | Copy-ready template (with item name): <code><nowiki>{{ItemIcon|name=|show_name=true}}</nowiki></code> | ||
== Examples == | === 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 --> |