X-Wing Miniatures: Second Edition Wiki
Advertisement

This is a portal to all the templates we admins commonly have to edit, e.g. to update points or infobox data.

Hyperspace Legal

This template lists all hyperspace legal ships, outputting "yes" if the ship is listed. Everyone else is "no".

Upgrade Card Points

Main template for upgrades: Template:Upgrade Points (redirects to one of these below)

Pilot Card Points

Main template for pilots: Template:Ship Points (redirects to one of the ships below to handle the pilot)

The ships below are using shortened names, but they're ordered by their long name to try to match the order in FFG's points PDF document.

First Order

Galactic Empire

Galactic Republic

Rebel

Resistance

Scum

Separatist Alliance

Huge Ships

Upgrade Slots

Infoboxes

Ship Lists

Explanation

How Do I Add Ships?

First off, if all you need is to add a ship, you should add it to its "Faction-Specific Template" in that section below. For example, if the First Order gets a new ship, edit Template:Ships First Order to add it. Once you have its icon, also add that to Template:ShipLink (it's fine if it's missing, it'll just display a ? icon in the mean time).

Ship Navbox & List Template Structure

In case you ever need to modify any fundamentals, here's how these templates are structured.

List a Faction's Ship in a Template

Each Template:Ships (Faction) (for example, Template:Ships Galactic Empire) lists the ships for that faction in alphabetical order with a configurable separator, such as a newline, •, -, etc.

Open up one of those templates and you'll just see a bunch of ships listed in curly brackets to make them into links with icons (see Template:ShipLink), with a separator parameter that defaults to •. It's graciously low-tech which makes it easy to edit for updates, and the same template can either make a horizontal list of ships like A • B • C, or it can list them vertically with a newline, or perhaps even a table, depending on the separator passed to it.

Use the Template in a Faction Navbox

Navbox:Ships (Faction) (for example, Navbox:Ships Galactic Empire) calls into Template:Navbox Ships One Faction, passing in the faction name (it's really just a thin wrapper, and perhaps not entirely necessary?). That template then uses that faction name to form the name of the next template to call, "Ships (Faction)" above. The resulting ship list is shoved into "list1" of the Template:CollapsibleNavbox, along with also displaying the faction name in the navbox title etc.

The end result is a Navbox page that can be included in any other page with a single line, e.g. <nowiki>{{:Navbox:Ships Scum And Villainy}}</nowiki>.

Use the Templates in an All-Faction Navbox

Navbox:Ships does the same sort of thing, but calls into Template:Navbox Ships rather than the One-Faction template, so that we get the list of all ships. It's using the CollapsibleNavbox too but has one group per faction (instead of just group1 & list1).

Bringing It Together

The Ships page creates a table where each faction's cell is nothing more than a call to "Template:Ships (faction)" with a newline as the separator. So each faction's ship section is just a simple vertical list of ships.

The Ships navbox at the bottom of, say, Firespray-class Patrol Craft, just involves including the faction's navbox into the page: <nowiki>{{:Navbox:Ships Scum And Villainy}}</nowiki>. The default • separator results in a horizontal ship list in the collapsible navbox.

Why God Why!?

If all this sounds complicated, that's because it is. The goal of all that complexity is, ironically, simplicity: We only have to edit one template to add a ship, and doing so simultaneously updates both the Ships page and the ship list at the bottom of every ship page. Did the First Order get a new ship? Great! Create its page and add its link to Template:Ships First Order and everything updates!

Template List

Here's a full list of the Templates and Navboxes.

Faction-Specific Templates (Faction Ship Lists)

These contain the actual lists of ships for each faction, which we can include in any other template or page we like. If you want to add a new ship, add it to the correct faction(s) below.

Top-Level Templates

Navbox Pages

These are what we'll actually include in a ship's page. This gives us one point of contact for any params we want to push into that faction's templates, such as the separator or font size. They're really just thin wrappers that call out to the templates with params.

Base Template for Collapsible Navboxes

This is the collapsible navbox template used for Ships and Products (and possibly other stuff). Note that some changes could require changing the wiki's stylesheet, which is not a task to be taken on lightly!

This general-purpose navbox is also used for multiple purposes (ships, products), so edits for the benefit of one can affect the others; just a heads-up to test everything after a change.

Product Lists

The product list template shows a navbox at the top of each product page, allowing the pages to behave like the old tabbed view for easy navigation. It just lists all the product pages in a CollapsibleNavbox.

Infoicons

Critical Hit Cards

Advertisement