Jump to content

Template:Infobox Event: Difference between revisions

From Xandaris Wiki
Create reusable infobox template for event pages
 
Switch to HTML table to fix whitespace
Line 1: Line 1:
<includeonly>{| class="wikitable" style="float:right; margin-left:1em;"
<includeonly><table class="wikitable" style="float:right; margin-left:1em;">
|-
<tr><th colspan="2">{{{name|{{PAGENAME}}}}}</th></tr>
! colspan="2" | {{{name|{{PAGENAME}}}}}
{{#if:{{{image|}}}|<tr><td colspan="2" style="text-align:center;">[[File:{{{image}}}|250px]]</td></tr>}}
{{#if:{{{image|}}}|
{{#if:{{{date|}}}|<tr><td>'''Date'''</td><td>{{{date}}}</td></tr>}}
{{!}}-
{{#if:{{{location|}}}|<tr><td>'''Location'''</td><td>{{{location}}}</td></tr>}}
{{!}} colspan="2" style="text-align:center;" {{!}} [[File:{{{image}}}|250px]]
{{#if:{{{victim|}}}|<tr><td>'''{{#if:{{{victim2|}}}|Victims|Victim}}'''</td><td>{{{victim}}}{{#if:{{{victim2|}}}|, {{{victim2}}}}}{{#if:{{{victim3|}}}|, {{{victim3}}}}}</td></tr>}}
}}
{{#if:{{{killer|}}}|<tr><td>'''{{#if:{{{killer2|}}}|Killers|Killer}}'''</td><td>{{{killer}}}{{#if:{{{killer2|}}}|, {{{killer2}}}}}{{#if:{{{killer3|}}}|, {{{killer3}}}}}</td></tr>}}
{{#if:{{{date|}}}|
{{#if:{{{weapon|}}}|<tr><td>'''Weapon'''</td><td>{{{weapon}}}</td></tr>}}
{{!}}-
{{#if:{{{motive|}}}|<tr><td>'''Motive'''</td><td>{{{motive}}}</td></tr>}}
{{!}} '''Date''' {{!}}{{!}} {{{date}}}
{{#if:{{{witnesses|}}}|<tr><td>'''Witnesses'''</td><td>{{{witnesses}}}</td></tr>}}
}}
{{#if:{{{outcome|}}}|<tr><td>'''Outcome'''</td><td>{{{outcome}}}</td></tr>}}
{{#if:{{{location|}}}|
{{#if:{{{preceded_by|}}}|<tr><td>'''Preceded By'''</td><td>{{{preceded_by}}}</td></tr>}}
{{!}}-
{{#if:{{{followed_by|}}}|<tr><td>'''Followed By'''</td><td>{{{followed_by}}}</td></tr>}}
{{!}} '''Location''' {{!}}{{!}} {{{location}}}
</table></includeonly>
}}
<noinclude>
{{#if:{{{victim|}}}|
{{!}}-
{{!}} '''{{#if:{{{victim2|}}}|Victims|Victim}}''' {{!}}{{!}} {{{victim}}}{{#if:{{{victim2|}}}|, {{{victim2}}}}}{{#if:{{{victim3|}}}|, {{{victim3}}}}}
}}
{{#if:{{{killer|}}}|
{{!}}-
{{!}} '''{{#if:{{{killer2|}}}|Killers|Killer}}''' {{!}}{{!}} {{{killer}}}{{#if:{{{killer2|}}}|, {{{killer2}}}}}{{#if:{{{killer3|}}}|, {{{killer3}}}}}
}}
{{#if:{{{weapon|}}}|
{{!}}-
{{!}} '''Weapon''' {{!}}{{!}} {{{weapon}}}
}}
{{#if:{{{motive|}}}|
{{!}}-
{{!}} '''Motive''' {{!}}{{!}} {{{motive}}}
}}
{{#if:{{{witnesses|}}}|
{{!}}-
{{!}} '''Witnesses''' {{!}}{{!}} {{{witnesses}}}
}}
{{#if:{{{outcome|}}}|
{{!}}-
{{!}} '''Outcome''' {{!}}{{!}} {{{outcome}}}
}}
{{#if:{{{preceded_by|}}}|
{{!}}-
{{!}} '''Preceded By''' {{!}}{{!}} {{{preceded_by}}}
}}
{{#if:{{{followed_by|}}}|
{{!}}-
{{!}} '''Followed By''' {{!}}{{!}} {{{followed_by}}}
}}
|}</includeonly><noinclude>
== Usage ==
== Usage ==
<pre>
<pre>

Revision as of 22:11, 1 March 2026


Usage

{{Infobox Event
| name        =
| image       =
| date        =
| location    =
| victim      =
| victim2     =
| victim3     =
| killer      =
| killer2     =
| killer3     =
| weapon      =
| motive      =
| witnesses   =
| outcome     =
| preceded_by =
| followed_by =
}}

All fields are optional. name defaults to {{PAGENAME}}.

When multiple victims or killers are provided, the label auto-pluralizes (e.g. "Victim" → "Victims").