TenthFleet:Infobox construction

Revision as of 09:04, 17 July 2026 by MDGarcia (talk | contribs) (Add Editor's Handbook read-in-order side navbox)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This page explains how the wiki's infoboxes are built, so you can add a field to an existing one or create a new one. Every infobox on this wiki follows the same simple pattern.

An infobox is really two pages working together: the template that lays out the box, and a stylesheet that colors it.

The two parts

Take {{Infobox-award}} as the model:

  • Template:Infobox-award is the layout. It starts with <includeonly><templatestyles src="Infobox-award/styles.css" />, then builds a table with the class tf-abox.
  • Template:Infobox-award/styles.css is the look. It defines the tf-abox classes using the theme variables from Common.css.

How a field works

Each row of the box is wrapped so it only appears when the editor fills that field in. The pattern looks like this:

{{#if:{{{motto|}}}|
{{!}}-
{{!}} class="tf-abox-l" {{!}} '''Motto:'''
{{!}} class="tf-abox-r" {{!}} {{{motto}}}}}

Reading that plainly: if the motto field has a value, add a table row with a bold label and the value; otherwise add nothing. The {{!}} is how you write a table pipe character inside a template.

Why the pipe helper is needed
A plain | inside a template call would be read as the start of a new parameter. The {{!}} helper tells the software you mean a literal pipe, which is what tables are made of.

Adding a field to an existing infobox

  1. Open the template, for example Template:Infobox-award.
  2. Copy an existing field block and change the field name and label.
  3. Save, then check a page that uses the infobox to confirm the new row appears only when filled.

Creating a new infobox

  1. Create Template:Infobox-yourname/styles.css first, copying an existing stylesheet such as Infobox-award/styles.css and renaming the classes.
  2. Create Template:Infobox-yourname, pull in the stylesheet, and build the rows with the if-guard pattern above.
  3. Wrap the whole thing in <includeonly>...</includeonly> so the raw markup does not show on the template's own page, and add documentation in a <noinclude>...</noinclude> block.
Start from a copy
The fastest and safest way to make a new infobox is to copy the closest existing one and adjust it, rather than starting from a blank page.


Tenth Fleet Wiki — Editor Documentation
Start here Contributor's guide · Introduction · Be bold · Editing basics
Style & layout Manual of Style · Guide to layout · Naming conventions · Namespaces · Citing sources
Building content Peerage page · Award page · Ship page · Echelon page · Order · News item
Templates Template guide
Deep dives Styling & theme · Infoboxes · Navboxes · Dynamic lists (DPL) · Supersession · Categories
Policies & Guidelines