Template:ItemBox/doc: Difference between revisions

Vergir (talk | contribs)
Document the new |size= param in TemplateData and add size examples (with help from vergir-bot LLM)
Vergir (talk | contribs)
Rewrite doc: Usage / Parameters / Examples / References structure; document size param; add tier/size/override example galleries (with help from vergir-bot LLM)
Line 1: Line 1:
{{TS}}
{{TS}}
The data for each item is populated from [[Data:ItemData.json]] and retrieved by [[Module:ItemData]].
== Usage ==
===Examples===
<pre>
{{ItemBox|Close Quarters}}
{{ItemBox|Spirit Shredder Bullets}}
{{ItemBox|Shadow Weave}}
{{ItemBox|Silencer}}
{{ItemBox|Haunting Shot}}
{{ItemBox|Extra Health}}
{{ItemBox|Bullet Lifesteal|overrideLinkClick = Bullet_Lifesteal_(item)}}
{{ItemBox|Dispel Magic}}
{{ItemBox|Unstoppable}}
{{ItemBox|Celestial Blessing}}
{{ItemBox|Golden Goose Egg}}
{{ItemBox|Duration Extender}}
{{ItemBox|Surge of Power}}
{{ItemBox|Echo Shard}}
{{ItemBox|Frostbite Charm}}
</pre>


{{ItemBox|Close Quarters}}
{{tl|ItemBox}} renders a Deadlock shop item as a card: icon, tier art, and the item name auto-sized to fit. Pass an item name and everything else — tier, slot, tags, image — is pulled from [[Module:ItemData]].
{{ItemBox|Spirit Shredder Bullets}}
{{ItemBox|Shadow Weave}}
{{ItemBox|Silencer}}
{{ItemBox|Haunting Shot}}
{{ItemBox|Extra Health}}
{{ItemBox|Bullet Lifesteal|overrideLinkClick = Bullet_Lifesteal_(item)}}
{{ItemBox|Dispel Magic}}
{{ItemBox|Unstoppable}}
{{ItemBox|Celestial Blessing}}
{{ItemBox|Golden Goose Egg}}
{{ItemBox|Duration Extender}}
{{ItemBox|Surge of Power}}
{{ItemBox|Echo Shard}}
{{ItemBox|Frostbite Charm}}


<pre>
<pre>
{{ItemBox|Restorative Shot|showTierTag = true}}
{{ItemBox|Extended Magazine}}
{{ItemBox|High-Velocity Rounds|overrideDisplayName = Test Name}}
{{ItemBox|Intensifying Magazine|overrideTier = 4}}
{{ItemBox|Weakening Headshot|overrideSlot = Tech}}
{{ItemBox|Recharging Rush|overrideIsActive = true}}
{{ItemBox|Alchemical Fire|overrideIsImbue = true}}
{{ItemBox|Ballistic Enchantment|overrideLinkTooltip = Extended Magazine}}
{{ItemBox|Escalating Resilience|overrideLinkImage = Extended Magazine}}
{{ItemBox|Headhunter|overrideLinkClick = Extended Magazine}}
{{ItemBox|Titanic Magazine|size = 1.5}}
{{ItemBox|Berserker|size = 0.75}}
</pre>
</pre>
{{ItemBox|Extended Magazine}}
== Parameters ==


{{ItemBox|Restorative Shot|showTierTag = true}}
{{ItemBox|High-Velocity Rounds|overrideDisplayName = Test Name}}
{{ItemBox|Intensifying Magazine|overrideTier = 4}}
{{ItemBox|Weakening Headshot|overrideSlot = Tech}}
{{ItemBox|Recharging Rush|overrideIsActive = true}}
{{ItemBox|Alchemical Fire|overrideIsImbue = true}}
{{ItemBox|Ballistic Enchantment|overrideLinkTooltip = Extended Magazine}}
{{ItemBox|Escalating Resilience|overrideLinkImage = Extended Magazine}}
{{ItemBox|Headhunter|overrideLinkClick = Extended Magazine}}
{{ItemBox|Titanic Magazine|size = 1.5}}
{{ItemBox|Berserker|size = 0.75}}
<templatedata>
<templatedata>
{
{
"description": "Renders a Deadlock shop item card.",
"params": {
"params": {
"itemName": {
"itemName": {
    "label": "Item Name",
"label": "Item name",
"description": "Name of the item. Will be used to get the item data from [[Module:ItemData]]",
"description": "Item name; keys into Module:ItemData. Positional.",
"example": "Extended Magazine",
"type": "string",
"type": "string",
"required": true,
"required": true,
"aliases": ["1"]
"aliases": ["1"],
},
"example": "Extended Magazine"
"showTierTag": {
    "label": "Show Tier Tag",
"description": "Enable a tag top right on the card to show its tier.",
"suggestedvalues": ["true, false"],
"type": "string"
},
},
"size": {
"size": {
    "label": "Size",
"label": "Size",
"description": "Scales the whole card. 1 = default (80px wide), 1.5 = 150%, 0.75 = 75%.",
"description": "Scales the whole card. 1 = default (80px wide), 1.5 = 150%, 0.75 = 75%.",
"example": "1.5",
"type": "number",
"type": "number",
"default": "1"
"default": "1",
"example": "1.5"
},
"showTierTag": {
"label": "Show tier tag",
"description": "Set to true to show the tier corner badge.",
"type": "boolean",
"suggestedvalues": ["true", "false"]
},
},
"overrideDisplayName": {
"overrideDisplayName": {
    "label": "Override Display Name",
"label": "Override display name",
"description": "Overrides the name that is displayed on the card.",
"description": "Replaces the name shown on the card.",
"example": "Test",
"type": "string",
"type": "string"
"example": "Test Name"
},
},
"overrideTier": {
"overrideTier": {
    "label": "Override Tier",
"label": "Override tier",
"description": "Overrides the cards tier.",
"description": "Replaces the card's tier.",
"suggestedvalues": ["1, 2, 3, 4, 5"],
"type": "number",
"type": "string"
"suggestedvalues": ["1", "2", "3", "4", "5"]
},
},
"overrideSlot": {
"overrideSlot": {
    "label": "Override Slot",
"label": "Override slot",
"description": "Overrides the cards slot type.",
"description": "Replaces the card's slot.",
"suggestedvalues": ["Weapon, Armor, Tech"],
"type": "string",
"type": "string"
"suggestedvalues": ["Weapon", "Armor", "Tech"]
},
},
"overrideIsActive": {
"overrideIsActive": {
    "label": "Override Is Active",
"label": "Override active tag",
"description": "Overrides the ACTIVE tag.",
"description": "Forces the ACTIVE tag on or off.",
"suggestedvalues": ["true, false"],
"type": "boolean",
"type": "string"
"suggestedvalues": ["true", "false"]
},
},
"overrideIsImbue": {
"overrideIsImbue": {
    "label": "Override Is Imbue",
"label": "Override imbue tag",
"description": "Overrides the IMBUE tag.",
"description": "Forces the IMBUE tag on or off.",
"suggestedvalues": ["true, false"],
"type": "boolean",
"type": "string"
"suggestedvalues": ["true", "false"]
},
},
"overrideLinkTooltip": {
"overrideLinkTooltip": {
    "label": "Override Link Tooltip",
"label": "Override tooltip source",
"description": "Overrides the link from where the tooltip gets its info.",
"description": "Page the hover tooltip reads its info from.",
"example": "Extended Magazine",
"type": "string",
"type": "string"
"example": "Extended Magazine"
},
},
"overrideLinkImage": {
"overrideLinkImage": {
    "label": "Override Link Image",
"label": "Override image",
"description": "Overrides the link from where the ItemBox gets the image.",
"description": "Page/file the icon image comes from.",
"example": "Extended Magazine",
"type": "string",
"type": "string"
"example": "Extended Magazine"
},
},
"overrideLinkClick": {
"overrideLinkClick": {
    "label": "Override Link Click",
"label": "Override click link",
"description": "Overrides where the ItemBox links to when clicked on.",
"description": "Page the card links to when clicked.",
"example": "Bullet Lifesteal (item)",
"type": "string",
"type": "string"
"example": "Bullet Lifesteal (item)"
}
}
},
},
"description": " "
"paramOrder": [
"itemName", "size", "showTierTag",
"overrideDisplayName", "overrideTier", "overrideSlot",
"overrideIsActive", "overrideIsImbue",
"overrideLinkTooltip", "overrideLinkImage", "overrideLinkClick"
],
"format": "inline"
}
}
</templatedata><noinclude>[[Category:Template documentation]]</noinclude>
</templatedata>
 
== Examples ==
 
=== Basic ===
 
<pre>
{{ItemBox|Close Quarters}}
{{ItemBox|Spirit Shredder Bullets}}
{{ItemBox|Silencer}}
{{ItemBox|Extra Health}}
{{ItemBox|Echo Shard}}
{{ItemBox|Celestial Blessing}}
</pre>
{{ItemBox|Close Quarters}}
{{ItemBox|Spirit Shredder Bullets}}
{{ItemBox|Silencer}}
{{ItemBox|Extra Health}}
{{ItemBox|Echo Shard}}
{{ItemBox|Celestial Blessing}}
 
=== Tier tag ===
 
<pre>
{{ItemBox|Extended Magazine|showTierTag = true}}
{{ItemBox|Berserker|showTierTag = true}}
{{ItemBox|Echo Shard|showTierTag = true}}
{{ItemBox|Celestial Blessing|showTierTag = true}}
</pre>
{{ItemBox|Extended Magazine|showTierTag = true}}
{{ItemBox|Berserker|showTierTag = true}}
{{ItemBox|Echo Shard|showTierTag = true}}
{{ItemBox|Celestial Blessing|showTierTag = true}}
 
=== Size ===
 
<pre>
{{ItemBox|Extended Magazine|size = 0.75}}
{{ItemBox|Extended Magazine}}
{{ItemBox|Extended Magazine|size = 1.5}}
</pre>
{{ItemBox|Extended Magazine|size = 0.75}}
{{ItemBox|Extended Magazine}}
{{ItemBox|Extended Magazine|size = 1.5}}
 
=== Overrides ===
 
<pre>
{{ItemBox|High-Velocity Rounds|overrideDisplayName = Test Name}}
{{ItemBox|Intensifying Magazine|overrideTier = 4}}
{{ItemBox|Weakening Headshot|overrideSlot = Tech}}
{{ItemBox|Recharging Rush|overrideIsActive = true}}
{{ItemBox|Alchemical Fire|overrideIsImbue = true}}
{{ItemBox|Bullet Lifesteal|overrideLinkClick = Bullet_Lifesteal_(item)}}
</pre>
{{ItemBox|High-Velocity Rounds|overrideDisplayName = Test Name}}
{{ItemBox|Intensifying Magazine|overrideTier = 4}}
{{ItemBox|Weakening Headshot|overrideSlot = Tech}}
{{ItemBox|Recharging Rush|overrideIsActive = true}}
{{ItemBox|Alchemical Fire|overrideIsImbue = true}}
{{ItemBox|Bullet Lifesteal|overrideLinkClick = Bullet_Lifesteal_(item)}}
 
== References ==
 
* Item data — [[Data:ItemData.json]], read by [[Module:ItemData]]
* Name sizing and texture variety — [[Module:ItemBox]]
* Card styling — [[Template:ItemBox/styles.css]]
 
<noinclude>[[Category:Template documentation]]</noinclude>