Template:Infobox: Difference between revisions

Current answers. Practical procedures. Reliable reference.
Jump to navigation Jump to search
Extend from 6 to 12 label/row pairs for the upcoming Engineer infobox (no CSS change needed -- .edfm-infobox-row isn't numbered)
Always render the image slot with a placeholder when unset, so the portrait spot is visible on Engineer pages even before images are added
Line 1: Line 1:
<div class="edfm-infobox">
<div class="edfm-infobox">
<div class="edfm-infobox-title">{{{name|{{PAGENAME}}}}}</div>{{#if:{{{image|}}}|
<div class="edfm-infobox-title">{{{name|{{PAGENAME}}}}}</div>
<div class="edfm-infobox-image">[[File:{{{image}}}|220px]]</div>}}{{#if:{{{row1|}}}|
<div class="edfm-infobox-image">{{#if:{{{image|}}}|[[File:{{{image}}}|220px]]|<div class="edfm-infobox-image-placeholder">No image available</div>}}</div>{{#if:{{{row1|}}}|
<div class="edfm-infobox-row"><div class="edfm-infobox-label">{{{label1|}}}</div><div class="edfm-infobox-value">{{{row1|}}}</div></div>}}{{#if:{{{row2|}}}|
<div class="edfm-infobox-row"><div class="edfm-infobox-label">{{{label1|}}}</div><div class="edfm-infobox-value">{{{row1|}}}</div></div>}}{{#if:{{{row2|}}}|
<div class="edfm-infobox-row"><div class="edfm-infobox-label">{{{label2|}}}</div><div class="edfm-infobox-value">{{{row2|}}}</div></div>}}{{#if:{{{row3|}}}|
<div class="edfm-infobox-row"><div class="edfm-infobox-label">{{{label2|}}}</div><div class="edfm-infobox-value">{{{row2|}}}</div></div>}}{{#if:{{{row3|}}}|
Line 37: Line 37:
future article genuinely needs more than 12, add further
future article genuinely needs more than 12, add further
<code>rowN</code>/<code>labelN</code> pairs here the same way.
<code>rowN</code>/<code>labelN</code> pairs here the same way.
The image slot always renders directly under the title, whether or not
<code>|image=</code> is set (added 2026-08-07 for the Engineer roster,
none of which have portrait images yet). With no <code>|image=</code>, it
shows a dashed-border "No image available" placeholder
(<code>.edfm-infobox-image-placeholder</code> in Common.css) instead of
disappearing, so editors can see at a glance where a portrait belongs and
readers aren't left wondering if something failed to load.


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 21:08, 7 August 2026

Infobox
No image available

Usage

A generic, right-floated reference infobox — styling lives in MediaWiki:Common.css (.edfm-infobox), not inline, so it stays consistent and easy to retheme later.

{{Infobox
 |name = Display title (defaults to the page name)
 |image = Filename.png (optional)
 |label1 = Type     |row1 = Multipurpose
 |label2 = Manufacturer |row2 = ...
 |label3 = ...      |row3 = ...
}}

Up to 12 label/row pairs (extended 2026-08-07 for the Engineer infobox, which needs around 10 — see [[Elite Dangerous Field Manual:Engineering Architecture]]). No matching CSS change was needed to extend this: the .edfm-infobox-row class in Common.css isn't numbered per-row, so any number of rows renders correctly with the existing styles. If a future article genuinely needs more than 12, add further rowN/labelN pairs here the same way.

The image slot always renders directly under the title, whether or not |image= is set (added 2026-08-07 for the Engineer roster, none of which have portrait images yet). With no |image=, it shows a dashed-border "No image available" placeholder (.edfm-infobox-image-placeholder in Common.css) instead of disappearing, so editors can see at a glance where a portrait belongs and readers aren't left wondering if something failed to load.