Template:Item icon: Difference between revisions
(Remove no results text) |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly><onlyinclude>{{#cargo_query: | <includeonly><onlyinclude>{{#cargo_query: | ||
tables=item_icon | tables=item_icon | ||
|fields=icon | |fields=TRIM(icon) | ||
|where=item_icon.name='{{{name}}}' | |where=item_icon.name='{{{name}}}' | ||
|limit=1 | |limit=1 | ||
|default= | |default= | ||
|template= | |template=ItemIcon Internal | ||
|more results text= | |more results text= | ||
}}{{#if:{{{showname|}}}|[[{{{name}}}]] }}</onlyinclude></includeonly><noinclude> | }}{{#if:{{{showname|}}}|[[{{{name}}}]] }}</onlyinclude></includeonly><noinclude> |
Revision as of 06:25, 5 September 2023
This template defines the table "item_icon". View table.
This template fetches an icon for an item using Cargo. It also declares the Cargo table for the "item_icon" table that stores this information. The information is uploaded using the standard item descriptions.
Usage:{{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. }}
Templates
Copy-ready template (no item name): {{ItemIcon|name=}}
Copy-ready template (with item name): {{ItemIcon|name=|show_name=true}}
Examples
Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,TRIM(icon) FROM `cargo__item_icon` WHERE `cargo__item_icon`.`name`='Potion of Healing' ORDER BY `cargo__item_icon`.`_pageID`,TRIM(icon) LIMIT 100
Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,TRIM(icon) FROM `cargo__item_icon` WHERE `cargo__item_icon`.`name`='Potion of Healing' ORDER BY `cargo__item_icon`.`_pageID`,TRIM(icon) LIMIT 100
Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,TRIM(icon) FROM `cargo__item_icon` WHERE `cargo__item_icon`.`name`='Potion of Healing' ORDER BY `cargo__item_icon`.`_pageID`,TRIM(icon) LIMIT 100