Template:Item icon: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
m (mention ItemIcon Insert)
(More around desc a bit. Space between icon and text)
Line 9: Line 9:
|format=template
|format=template
|template=ItemIcon Internal
|template=ItemIcon Internal
}}{{#if:{{{show_name|}}}|[[{{{name}}}]] }}</onlyinclude></includeonly><noinclude>
}} {{#if:{{{show_name|}}}|[[{{{name}}}]] }}</onlyinclude></includeonly><noinclude>


<!-- Cargo table definition -->
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]].
{{#cargo_declare:
_table = item_icon
|name = String
|icon = File
}}
 
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. Use [[Template:ItemIcon Insert]] to add a page that doesn't use [[Template:MiscItemPage]], [[Template:EquipmentPage]], or [[Template:WeaponPage]].


Usage: <pre>{{ItemIcon
Usage: <pre>{{ItemIcon
Line 41: Line 34:
<code><nowiki>{{ItemIcon|name=The Red Knight's Final Stratagem}} (testing that pages with ' work)</nowiki></code> {{ItemIcon|name=The Red Knight's Final Stratagem}}
<code><nowiki>{{ItemIcon|name=The Red Knight's Final Stratagem}} (testing that pages with ' work)</nowiki></code> {{ItemIcon|name=The Red Knight's Final Stratagem}}


<!-- Cargo table definition -->
{{#cargo_declare:
_table = item_icon
|name = String
|icon = File
}}
</noinclude>
</noinclude>

Revision as of 09:57, 6 September 2023


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.

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

{{ItemIcon|name=Potion of Healing}}
Error 1054: Unknown column 'cargo__item_icon.name' in 'order clause'

Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,TRIM(icon),CONCAT(, '40') FROM `cargo__item_icon` WHERE `cargo__item_icon`.`_pageName`="Potion of Healing" ORDER BY `cargo__item_icon`.`name` LIMIT 100

{{ItemIcon|name=Potion of Healing|size=30}}
Error 1054: Unknown column 'cargo__item_icon.name' in 'order clause'

Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,TRIM(icon),CONCAT(, '30') FROM `cargo__item_icon` WHERE `cargo__item_icon`.`_pageName`="Potion of Healing" ORDER BY `cargo__item_icon`.`name` LIMIT 100

{{ItemIcon|name=Potion of Healing|size=24|show_name=true}}
Error 1054: Unknown column 'cargo__item_icon.name' in 'order clause'

Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,TRIM(icon),CONCAT(, '24') FROM `cargo__item_icon` WHERE `cargo__item_icon`.`_pageName`="Potion of Healing" ORDER BY `cargo__item_icon`.`name` LIMIT 100

Potion of Healing {{ItemIcon|name=The Red Knight's Final Stratagem}} (testing that pages with ' work)
Error 1054: Unknown column 'cargo__item_icon.name' in 'order clause'

Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,TRIM(icon),CONCAT(, '40') FROM `cargo__item_icon` WHERE `cargo__item_icon`.`_pageName`="The Red Knight's Final Stratagem" ORDER BY `cargo__item_icon`.`name` LIMIT 100

This template defines the table "item_icon". View table.