Template:Infobox: Difference between revisions
More actions
m Infobox tournament: auto-generate a lead paragraph from the same infobox parameters |
m Replace reader-visible prose double hyphens with a proper em dash entity |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly><templatestyles src="Template:Infobox/styles.css" /><div class="loka-infobox{{#if:{{{wide|}}}| loka-infobox--wide}}"><div class="loka-infobox-name">{{{name|{{PAGENAME}}}}}</div>{{#if:{{{type|}}}|<div class="loka-infobox-type">{{{type}}}</div>}}{{#if:{{{image|}}}|<div class="loka-infobox-image">[[File:{{{image}}}|{{{imagesize|250px}}}|frameless|alt={{{name|{{PAGENAME}}}}}]]</div>}}{{{content|}}}</div></includeonly><noinclude> | <includeonly><templatestyles src="Template:Infobox/styles.css" /><div class="loka-infobox{{#if:{{{wide|}}}| loka-infobox--wide}}">{{#if:{{{headerimage|}}}|{{#ifexist:File:{{{headerimage}}}|<div class="loka-infobox-header-photo">[[File:{{{headerimage}}}|600px|frameless|alt={{{name|{{PAGENAME}}}}}]]<div class="loka-infobox-header-scrim"></div><div class="loka-infobox-header-text"><div class="loka-infobox-name">{{{name|{{PAGENAME}}}}}</div>{{#if:{{{type|}}}|<div class="loka-infobox-type">{{{type}}}</div>}}</div></div>|<div class="loka-infobox-name">{{{name|{{PAGENAME}}}}}</div>{{#if:{{{type|}}}|<div class="loka-infobox-type">{{{type}}}</div>}}}}|<div class="loka-infobox-name">{{{name|{{PAGENAME}}}}}</div>{{#if:{{{type|}}}|<div class="loka-infobox-type">{{{type}}}</div>}}}}{{#if:{{{image|}}}|<div class="loka-infobox-image">[[File:{{{image}}}|{{{imagesize|250px}}}|frameless|alt={{{name|{{PAGENAME}}}}}]]</div>}}{{{content|}}}</div></includeonly><noinclude> | ||
== Usage == | == Usage == | ||
This is a shared metatemplate, not normally used directly on articles | This is a shared metatemplate, not normally used directly on articles — use [[Template:Infobox player]], [[Template:Infobox town]] or [[Template:Infobox tournament]] instead. It exists so every infobox on the wiki shares one visual language (transparent panel, faint borders, left-aligned rows) from one stylesheet, the way Wikipedia's <code>Template:Infobox</code> underlies <code>Template:Infobox person</code> and friends. | ||
A specific infobox template pre-renders its own rows (using the shared <code>.loka-infobox-row | A specific infobox template pre-renders its own rows (using the shared <code>.loka-infobox-row</code> markup pattern below, plus [[Template:Hlist|{{Hlist}}]] for any row listing multiple names) into one wikitext blob and passes it as <code>content</code>: | ||
<pre> | <pre> | ||
| Line 34: | Line 34: | ||
|- | |- | ||
| <code>content</code> | | <code>content</code> | ||
| Pre-rendered wikitext for everything below the header/image | | Pre-rendered wikitext for everything below the header/image — rows, and any section specific to that infobox. | ||
|- | |- | ||
| <code>wide</code> | | <code>wide</code> | ||
| Set to any non-empty value (e.g. <code>1</code>) to widen the box beyond the standard 300px via the <code>loka-infobox--wide</code> modifier class | | Set to any non-empty value (e.g. <code>1</code>) to widen the box beyond the standard 300px via the <code>loka-infobox--wide</code> modifier class — for infoboxes needing more horizontal room, e.g. [[Template:Infobox tournament]]'s two-column layout. | ||
|- | |||
| <code>headerimage</code> | |||
| Filename of an image uploaded to the wiki (no <code>File:</code> prefix). When given, the name and type badge are overlaid on top of it as a full-bleed photo banner spanning the very top of the box, instead of the plain header — see [[Template:Infobox tournament]]. Independent of (and normally used instead of) <code>image</code>. | |||
|} | |} | ||
| Line 51: | Line 54: | ||
| <code>loka-infobox-row--wide</code> | | <code>loka-infobox-row--wide</code> | ||
| Modifier for a row whose value needs its own line (e.g. a long list) instead of sitting beside the label. | | Modifier for a row whose value needs its own line (e.g. a long list) instead of sitting beside the label. | ||
|} | |} | ||
For a list of names inside a row's value (e.g. a list of players), use [[Template:Hlist|{{Hlist}}]] rather than hand-written markup. | |||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 14:17, 23 August 2026
Usage
This is a shared metatemplate, not normally used directly on articles — use Template:Infobox player, Template:Infobox town or Template:Infobox tournament instead. It exists so every infobox on the wiki shares one visual language (transparent panel, faint borders, left-aligned rows) from one stylesheet, the way Wikipedia's Template:Infobox underlies Template:Infobox person and friends.
A specific infobox template pre-renders its own rows (using the shared .loka-infobox-row markup pattern below, plus
for any row listing multiple names) into one wikitext blob and passes it as content:
{{Infobox
|name={{{name|{{PAGENAME}}}}}
|image={{{image|}}}
|type={{{type|}}}
|content=<!-- pre-built rows and any bespoke sections -->
}}
Parameters
| Parameter | Description |
|---|---|
name
|
Subject name shown in the header. Defaults to the page name. |
image
|
Filename of an image uploaded to the wiki (no File: prefix).
|
imagesize
|
Image width. Defaults to 250px.
|
type
|
Optional free-text badge shown under the name (e.g. a tournament's Player Run Festival).
|
content
|
Pre-rendered wikitext for everything below the header/image — rows, and any section specific to that infobox. |
wide
|
Set to any non-empty value (e.g. 1) to widen the box beyond the standard 300px via the loka-infobox--wide modifier class — for infoboxes needing more horizontal room, e.g. Template:Infobox tournament's two-column layout.
|
headerimage
|
Filename of an image uploaded to the wiki (no File: prefix). When given, the name and type badge are overlaid on top of it as a full-bleed photo banner spanning the very top of the box, instead of the plain header — see Template:Infobox tournament. Independent of (and normally used instead of) image.
|
Styling lives in Template:Infobox/styles.css, which defines the shared building blocks every specific infobox's content is built from:
| Class | Use |
|---|---|
loka-infobox-row / loka-infobox-row-key / loka-infobox-row-value
|
A standard label/value row. |
loka-infobox-row--wide
|
Modifier for a row whose value needs its own line (e.g. a long list) instead of sitting beside the label. |
For a list of names inside a row's value (e.g. a list of players), use
rather than hand-written markup.