Template:Item icon: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Created page with "<includeonly><onlyinclude>{{Icon |{{#cargo_query: tables=item_icon |fields=icon |where=item_icon.name={{{1}}} |limit=1 |format=list}} |{{{2|40}}}</onlyinclude></includeonly><noinclude> <!-- Cargo table definition --> {{#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...")
 
No edit summary
Line 3: Line 3:
   tables=item_icon
   tables=item_icon
   |fields=icon
   |fields=icon
   |where=item_icon.name={{{1}}}
   |where=item_icon.name={{{name}}}
   |limit=1
   |limit=1
   |format=list}}
   |format=list}}
|{{{2|40}}}</onlyinclude></includeonly><noinclude>
|{{{size|40}}}
}} {{#if:{{{show_name|}}}|[[{{{show_name}}]]}}</onlyinclude></includeonly><noinclude>


<!-- Cargo table definition -->
<!-- Cargo table definition -->
Line 17: Line 18:
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.
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: <code><nowiki>{{ItemIcon|the_items_page_name|optional_size}}</nowiki></code>
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.
}}</pre>


Example: {{ItemIcon|Potion of Healing}}
Examples:
{{ItemIcon|name=Potion of Healing}}
{{ItemIcon|name=Potion of Healing|size=24}}
{{ItemIcon|name=Potion of Healing|show_name=true}}


Copy-ready example: <code><nowiki>{{ItemIcon|}}</nowiki></code>
Copy-ready example (no item name): <code><nowiki>{{ItemIcon|name=}}</nowiki></code>
Copy-ready example (with item name): <code><nowiki>{{ItemIcon|name=|show_name=true}}</nowiki></code>


</noinclude>
</noinclude>

Revision as of 22:22, 31 August 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.
}}

Examples:

[[File:
Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'of Healing ORDER BY `cargo__item_icon`.`_pageID`,`icon` LIMIT 100' at line 1

Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,`icon` AS `icon` FROM `cargo__item_icon` WHERE `cargo__item_icon`.`name`=Potion of Healing ORDER BY `cargo__item_icon`.`_pageID`,`icon` LIMIT 100

|link=|x40px|alt=
Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'of Healing ORDER BY `cargo__item_icon`.`_pageID`,`icon` LIMIT 100' at line 1

Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,`icon` AS `icon` FROM `cargo__item_icon` WHERE `cargo__item_icon`.`name`=Potion of Healing ORDER BY `cargo__item_icon`.`_pageID`,`icon` LIMIT 100

|class=bg3wiki-icon ]] 
[[File:
Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'of Healing ORDER BY `cargo__item_icon`.`_pageID`,`icon` LIMIT 100' at line 1

Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,`icon` AS `icon` FROM `cargo__item_icon` WHERE `cargo__item_icon`.`name`=Potion of Healing ORDER BY `cargo__item_icon`.`_pageID`,`icon` LIMIT 100

|link=|x24px|alt=
Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'of Healing ORDER BY `cargo__item_icon`.`_pageID`,`icon` LIMIT 100' at line 1

Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,`icon` AS `icon` FROM `cargo__item_icon` WHERE `cargo__item_icon`.`name`=Potion of Healing ORDER BY `cargo__item_icon`.`_pageID`,`icon` LIMIT 100

|class=bg3wiki-icon ]] 
[[File:
Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'of Healing ORDER BY `cargo__item_icon`.`_pageID`,`icon` LIMIT 100' at line 1

Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,`icon` AS `icon` FROM `cargo__item_icon` WHERE `cargo__item_icon`.`name`=Potion of Healing ORDER BY `cargo__item_icon`.`_pageID`,`icon` LIMIT 100

|link=|x40px|alt=
Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'of Healing ORDER BY `cargo__item_icon`.`_pageID`,`icon` LIMIT 100' at line 1

Function: CargoSQLQuery::run Query: SELECT `cargo__item_icon`.`_pageID` AS `cargo_backlink_page_id_item_icon`,`icon` AS `icon` FROM `cargo__item_icon` WHERE `cargo__item_icon`.`name`=Potion of Healing ORDER BY `cargo__item_icon`.`_pageID`,`icon` LIMIT 100

|class=bg3wiki-icon ]] [[{Template:Show name]]

Copy-ready example (no item name): {{ItemIcon|name=}} Copy-ready example (with item name): {{ItemIcon|name=|show_name=true}}