Template:IconBox: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Create generic header-icon-text box split out of Template:AbilityInteraction; markup unchanged (with help from vergir-bot LLM) |
Emit data-ai-state so consumers can read box state from data attributes instead of CSS class names (with help from vergir-bot LLM) |
||
| Line 1: | Line 1: | ||
<includeonly><templatestyles src="IconBox/styles.css" /><div class="ai-box {{#if:{{{type|}}}|ai-type-{{{type}}}}} {{#switch:{{lc:{{{state|}}}}}|disabled=ai-disabled|partial=ai-partial}}" data-ai-icon="{{{iconfile|}}}" data-ai-title="{{{title|}}}"> | <includeonly><templatestyles src="IconBox/styles.css" /><div class="ai-box {{#if:{{{type|}}}|ai-type-{{{type}}}}} {{#switch:{{lc:{{{state|}}}}}|disabled=ai-disabled|partial=ai-partial}}" data-ai-icon="{{{iconfile|}}}" data-ai-title="{{{title|}}}" data-ai-state="{{#switch:{{lc:{{{state|}}}}}|disabled=disabled|partial=partial|#default=normal}}"> | ||
<div class="ai-header plainlinks">{{#if:{{{link|}}} | <div class="ai-header plainlinks">{{#if:{{{link|}}} | ||
|[{{#ifeq:{{lc:{{padleft:|4|{{{link|}}}}}}}|http|{{{link|}}}|https://deadlock.wiki/{{urlencode:{{{link|}}}|WIKI}}}} {{{title|}}}] | |[{{#ifeq:{{lc:{{padleft:|4|{{{link|}}}}}}}|http|{{{link|}}}|https://deadlock.wiki/{{urlencode:{{{link|}}}|WIKI}}}} {{{title|}}}] | ||
Revision as of 14:22, 15 July 2026
Usage
{{IconBox}} displays a box with a colored header, an icon, and a body of text.
Used by {{AbilityInteraction}}.
Parameters
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| title | title | Text shown in the box header. | String | required |
| text | text | Wikitext shown in the box body. May contain wikilinks, templates such as AbilityIcon, and lists. | Content | optional |
| type | type | Header color: positive (green), negative (red), or info (blue).
| String | required |
| iconfile | iconfile | File name of the icon image, without the File: prefix.
| String | required |
| link | link | Where the header and icon link. A bare page name (e.g. Healing Booster) or a full URL.
| String | required |
| state | state | Set to disabled to gray out the icon, partial to gray out half of it, or enhanced to add a blue glow.
| String | optional |
Examples
{{IconBox
| type = positive
| iconfile = Melee Charge.png
| link = Melee Charge
| title = Melee
| text = This ability benefits from Melee damage bonuses.
}}
This ability benefits from Melee damage bonuses.
Data attributes
The box carries several data attributes:
data-iconbox-icon,data-iconbox-title,data-iconbox-stateon its wrapper element.