Template:Image rarity item: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Created page with "<includeonly>{{#cargo_query: tables = item_icon | fields = TRIM(icon) = icon, CONCAT('', '{{{w|50}}}') = size, LOWER(rarity) = rarity, CONCAT('', "{{{1}}}") = page, CONCAT('', "{{{2|{{{1}}}}}}") = alias | where = {{#if: {{{uid|}}} | item_icon.uid = "{{{uid}}}" | item_icon._pageName="{{{1}}}" }} | limit = 1 | order by = item_icon._pageName | default = {{Image rarity item/Format|icon={{{1}}} Unfaded Icon.png|size={{{w|50}}}|rarity=common|pa...")
 
mNo edit summary
Line 34: Line 34:
{
{
"params": {
"params": {
"size": {
"1": {
"description": "The height of the item icon.",
"description": "The page of the item.",
"suggestedvalues": [
"40",
"25",
"20"
],
"default": "40",
"type": "number"
},
"name": {
"description": "The name of the icon. Identical to the item's page name.",
"example": "Potion of Healing",
"example": "Potion of Healing",
"required": true,
"required": true,
"type": "wiki-page-name"
"type": "wiki-page-name"
},
},
"show_name": {
"2": {
"description": "If non-empty, will link the icon as well.",
"type": "boolean"
},
"no_padding": {
"description": "Whether to remove exterior padding. Advanced use."
},
"show_rarity": {
"description": "If non-empty, will display an icon border corresponding to the rarity.",
"type": "boolean"
},
"override_icon": {
"description": "If provided, will override the icon with the provided one.",
"type": "string"
},
"override_rarity": {
"description": "If provided, will replace the fetched rarity.",
"type": "string"
},
"alias": {
"description": "An alias for the item.",
"description": "An alias for the item.",
"type": "string"
"type": "string"
},
},
"wrap": {
"w": {
"description": "If non-empty, will allow the item icon to wrap.",
"description": "The size of the item icon.",
"type": "boolean"
"suggestedvalues": [
"40",
"25",
"20"
],
"default": "50",
"type": "number"
},
},
"uid": {
"uid": {
Line 82: Line 59:
}
}
},
},
"description": "Inserts an item's icon automatically. Can also display a link to the item.",
"description": "Displays an item with rarity, with the icon above the text",
"paramOrder": [
"paramOrder": [
"name",
"1",
"2",
"uid",
"uid",
"size",
"w"
"show_name",
"no_padding",
"show_rarity",
"override_icon",
"override_rarity",
"alias",
"wrap"
],
],
"format": "inline"
"format": "inline"
}
}
</templatedata></noinclude>
</templatedata></noinclude>

Revision as of 07:28, 15 October 2024

This template is similar to RarityItem except it places the icon above the link to the item.

The default size is 50px (width and height).

Examples

Markup Renders as
{{Image rarity item|Moondrop Pendant}}

Moondrop Pendant
{{Image rarity item|Moondrop Pendant|Moon Pendant}}

Moon Pendant
{{Image rarity item|Moondrop Pendant|w=80}}

Moondrop Pendant

Template Data Section

Displays an item with rarity, with the icon above the text

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
11

The page of the item.

Example
Potion of Healing
Page namerequired
22

An alias for the item.

Stringoptional
uiduid

If specified, will instead search by UID.

Stringoptional
ww

The size of the item icon.

Suggested values
40 25 20
Default
50
Numberoptional