From Arms of God Wiki

bot: universal template Iconbox
 
bot: operator iteration 2026-06-10
Line 1: Line 1:
<includeonly><div class="wm-iconbox" style="display:inline-block; text-align:center; vertical-align:top; margin:2px; padding:4px;{{#if:{{{maxwidth|}}}|max-width:{{{maxwidth}}};}}"><!--
<includeonly>{{#invoke:Iconbox|render|{{{1|}}}|{{{2|}}}|size={{{size|24}}}}}</includeonly><noinclude>
IMAGE
-->{{#if:{{{nolink|}}}|<!--
no link wrap
-->[[File:{{{image|{{{name|{{{1|}}}}}}}}}.png|{{{size|48px}}}]]<!--
-->|<!--
linked
-->[[File:{{{image|{{{name|{{{1|}}}}}}}}}.png|{{{size|48px}}}|link={{{name|{{{1|}}}}}}]]<!--
-->}}{{#if:{{{amount|}}}|<sup class="wm-iconbox__amount" style="margin-left:-1em; background:rgba(0,0,0,0.6); color:#fff; padding:0 4px; border-radius:3px;">{{{amount}}}</sup>}}{{#if:{{{rarity|}}}|<span class="wm-iconbox__rarity cr-{{{rarity}}}"></span>}}<!--
CAPTION (default = name; "no" = hide; other = override)
-->{{#ifeq:{{{caption|}}}|no||<br/>{{#if:{{{nolink|}}}|<strong>{{{caption|{{{name|{{{1|}}}}}}}}}</strong>|[[{{{name|{{{1|}}}}}}|<strong>{{{caption|{{{name|{{{1|}}}}}}}}}</strong>]]}}}}<!--
--></div></includeonly><noinclude>
== Usage ==
== Usage ==
Atomic icon + caption + link cell. Cleaned generic version of the Brotato Iconbox pattern (see <code>library/Template_Iconbox.md</code>). The Brotato source has 200 lines of nested <code>#if</code> calling Brotato-specific helper templates (<code>GetRarity</code>, <code>GetDLCStatus</code>, <code>DLCBadge</code>); this version drops those and exposes their data as explicit params (<code>rarity</code>) instead.
Renders an entity's small icon (linked to its page) from [[Data:Icons.json]] via [[Module:Iconbox]]. Works for every weapon, character, blessing, upgrade, Crux power, passive, enemy, achievement and codex entry by display name or page slug.


<code><nowiki>{{Iconbox|Topaz_Brooch|size=32px|amount=3|rarity=common}}</nowiki></code>
* <code><nowiki>{{Iconbox|Cutter}} [[Cutter]]</nowiki></code> — icon only; you add the link text.
* <code><nowiki>{{Iconbox|Cutter|link}}</nowiki></code> — icon plus the linked display name.
* <code><nowiki>{{Iconbox|Ember Sword|link|size=32}}</nowiki></code> — bigger icon.


Params:
Entities without staged art (a few Crux powers and enemies) degrade gracefully: icon-only mode renders nothing, link mode renders the plain page link.
* <code>1</code> / <code>name</code> — entity name (also used as image filename + link target by default).
* <code>image</code> — override image filename (without .png extension).
* <code>size</code> — image size (default 48px).
* <code>amount</code> — small number overlay in the corner (e.g. stack count).
* <code>rarity</code> — slug matching a <code>.cr-{slug}</code> class from <code>MediaWiki:Common.css</code>. Renders a colored dot next to the icon.
* <code>caption</code> — override caption text. <code>no</code> hides the caption.
* <code>nolink</code> — set to <code>1</code> to suppress the wiki link.
* <code>maxwidth</code> — CSS max-width constraint.


<templatedata>
<templatedata>
{
{
   "description": "Atomic icon + caption + link cell. Inline gallery / list rendering.",
   "description": "Small linked entity icon from Data:Icons.json (optionally with linked name).",
   "params": {
   "params": {
     "1": {"aliases": ["name"], "label": "Name (image + link target by default)", "required": true},
     "1": {"label": "Entity name or slug", "required": true},
     "image": {"label": "Override image filename (without .png)"},
     "2": {"label": "Set to any value (e.g. 'link') to also render the linked name"},
     "size": {"label": "Image size", "example": "48px"},
     "size": {"label": "Icon size in px", "default": "24"}
    "amount": {"label": "Number overlay (stack count, quantity)", "type": "number"},
    "rarity": {"label": "Rarity slug (matches .cr-<slug> in Common.css)"},
    "caption": {"label": "Caption override ('no' to hide)"},
    "nolink": {"label": "Suppress wiki link (1 to enable)", "type": "boolean"},
    "maxwidth": {"label": "Max-width CSS constraint"}
   },
   },
   "paramOrder": ["1", "size", "amount", "rarity", "image", "caption", "nolink", "maxwidth"]
   "paramOrder": ["1", "2", "size"]
}
}
</templatedata>
</templatedata>
[[Category:Universal templates]]
[[Category:Universal templates]]
</noinclude>
</noinclude>

Revision as of 03:52, 10 June 2026

Usage

Renders an entity's small icon (linked to its page) from Data:Icons.json via Module:Iconbox. Works for every weapon, character, blessing, upgrade, Crux power, passive, enemy, achievement and codex entry by display name or page slug.

  • {{Iconbox|Cutter}} [[Cutter]] — icon only; you add the link text.
  • {{Iconbox|Cutter|link}} — icon plus the linked display name.
  • {{Iconbox|Ember Sword|link|size=32}} — bigger icon.

Entities without staged art (a few Crux powers and enemies) degrade gracefully: icon-only mode renders nothing, link mode renders the plain page link.

Small linked entity icon from Data:Icons.json (optionally with linked name).

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Entity name or slug1

no description

Unknownrequired
Set to any value (e.g. 'link') to also render the linked name2

no description

Unknownoptional
Icon size in pxsize

no description

Default
24
Unknownoptional