Template:Item icon: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(fix order by)
(add templatedata)
Line 40: Line 40:
|icon = File
|icon = File
}}
}}
</noinclude>
 
=== Template Data Section ===
 
<templatedata>
{
"params": {
"size": {
"description": "The height of the item icon. Optional.",
"suggestedvalues": [
"40",
"25",
"20"
],
"default": "40"
},
"name": {
"description": "The name of the icon. Identical to the item's page name.",
"example": "Potion of Healing",
"required": true
},
"show_name": {
"description": "Whether to link the icon as well. Optional. Providing any value at all will be interpreted as \"yes\"."
}
},
"description": "Inserts an item's icon automatically. Can also display a link to the item.",
"paramOrder": [
"name",
"size",
"show_name"
],
"format": "inline"
}
</templatedata></noinclude>

Revision as of 01:53, 8 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}}

{{ItemIcon|name=Potion of Healing|size=30}}

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

{{ItemIcon|name=The Red Knight's Final Stratagem}} (testing that pages with ' work)

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

Template Data Section

Inserts an item's icon automatically. Can also display a link to the item.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
namename

The name of the icon. Identical to the item's page name.

Example
Potion of Healing
Unknownrequired
sizesize

The height of the item icon. Optional.

Suggested values
40 25 20
Default
40
Unknownoptional
show_nameshow_name

Whether to link the icon as well. Optional. Providing any value at all will be interpreted as "yes".

Unknownoptional