From Arms of God Wiki
bot: publish Characters |
bot: documentation pass — editor-facing docs (data descriptions, module comments, template usage, Help rewrite) |
||
| Line 1: | Line 1: | ||
<includeonly | <includeonly><div class="infobox" style="border:2px solid var(--infobox-border, #3a3c44);background:var(--infobox-bg, #1c1d22);color:var(--infobox-text, #e6e6e6);padding:0.5em;float:right;width:280px;"> | ||
{| style="width:100%;" | {| style="width:100%;" | ||
! colspan="2" style="background:var(--infobox-header-bg, #26272e);color:var(--infobox-header-fg, #f1e9d2);font-size:1.2em;text-align:center;" | {{{name|}}} | ! colspan="2" style="background:var(--infobox-header-bg, #26272e);color:var(--infobox-header-fg, #f1e9d2);font-size:1.2em;text-align:center;" | {{{name|}}} | ||
| Line 80: | Line 16: | ||
{{#if:{{{desc|}}}|''{{{desc}}}''|}} | {{#if:{{{desc|}}}|''{{{desc}}}''|}} | ||
</includeonly><noinclude> | </includeonly><noinclude> | ||
== What this template does == | |||
Renders the infobox panel at the top right of every Character page. You normally never call it by hand: each detail page calls <code><nowiki>{{#invoke:Characters|infobox|id=<slug>}}</nowiki></code>, and [[Module:Core]] computes the values from [[Data:Characters.json]] at render time, then passes them to this template as parameters. This template is presentation only — row layout, header color, em-dash fallbacks. To change a VALUE, edit the source Data page; to change WHICH fields are computed, edit Module:Core; to change how the box looks, edit here. | |||
== Parameters == | |||
* <code>name</code> — display name, shown in the colored header. | |||
* <code>id</code> — the game's internal id, shown small under the icon. | |||
* <code>icon</code> — <code>File:</code> image name for the entity's icon. | |||
* <code>Availability</code> | |||
* <code>Stats</code> | |||
If you add or remove a row here, keep Module:Core's <code>INFOBOX_FIELD_ORDER.Characters</code> list in sync — that list decides which computed values get passed in. | |||
== Row shape == | |||
Every body row follows this exact shape (keep it when adding rows): | |||
<pre> | |||
|- | |||
! Label | |||
| {{#if:{{{Label|}}}|{{{Label}}}|—}} | |||
</pre> | |||
The row markers (<code>|-</code>, <code>!</code>, <code>|</code>) stay OUTSIDE the <code>#if</code>; only the value is conditional. Missing data then shows an em-dash instead of breaking the table layout. | |||
== Styling == | |||
Colors come from the site theme tokens (<code>var(--infobox-*, fallback)</code> — defined in [[MediaWiki:Common.css]], with inline fallbacks so the box renders correctly even without site CSS). | |||
</noinclude> | </noinclude> | ||
Latest revision as of 16:04, 10 June 2026
What this template does
Renders the infobox panel at the top right of every Character page. You normally never call it by hand: each detail page calls {{#invoke:Characters|infobox|id=<slug>}}, and Module:Core computes the values from Data:Characters.json at render time, then passes them to this template as parameters. This template is presentation only — row layout, header color, em-dash fallbacks. To change a VALUE, edit the source Data page; to change WHICH fields are computed, edit Module:Core; to change how the box looks, edit here.
Parameters
name— display name, shown in the colored header.id— the game's internal id, shown small under the icon.icon—File:image name for the entity's icon.AvailabilityStats
If you add or remove a row here, keep Module:Core's INFOBOX_FIELD_ORDER.Characters list in sync — that list decides which computed values get passed in.
Row shape
Every body row follows this exact shape (keep it when adding rows):
|-
! Label
| {{#if:{{{Label|}}}|{{{Label}}}|—}}
The row markers (|-, !, |) stay OUTSIDE the #if; only the value is conditional. Missing data then shows an em-dash instead of breaking the table layout.
Styling
Colors come from the site theme tokens (var(--infobox-*, fallback) — defined in MediaWiki:Common.css, with inline fallbacks so the box renders correctly even without site CSS).