User:David Newton/New Format Ship Table Tutorial

This template is an attempt to reproduce the functionality of each of the different types of table that have been developed for the WikiProject Ships in a more easily maintainable and centrally editable fashion. It has functionality to allow the common specifications of a ship class to be created in one template and then promulgated to all ships of that class, meaning all the information of all the ships of the class is as consistent as possible. It also has functionality to include or exclude certain optional table rows. For example, there would be little point in including the electronic warfare equipment of a sailing frigate, and little point in including the time required to activate a ship from reserve for a vessel already in active service.

The optional rows for the table are as follows:


 * 1) Purchased
 * 2) Commissioned
 * 3) Decommissioned
 * 4) In service
 * 5) Out of service
 * 6) Struck
 * 7) Homeport
 * 8) Range
 * 9) Test depth
 * 10) Capacity
 * 11) Time to activate
 * 12) Sensors
 * 13) Electronic warfare and decoys (with a variable EW)
 * 14) Armament
 * 15) Armour
 * 16) Aircraft

In order to include or exclude an optional row set the variable "Ship table optional row" to yes or no as appropriate. For example, for a ship without a cargo capacity the value "Ship table capacity=no" would be correct, where a ship with embarked aircraft would need the value "Ship table aircraft=yes". The one slight exception to that rule is the armour variable which is explained below.

A number of the rows allow the common features of a ship class to be reproduced across the whole class from one template. Those rows are:


 * 1) Displacement
 * 2) Length
 * 3) Beam
 * 4) Draught
 * 5) Propulsion
 * 6) Speed
 * 7) Range
 * 8) Test depth
 * 9) Capacity
 * 10) Complement
 * 11) Sensors
 * 12) Electronic warfare and decoys (with a variable EW)
 * 13) Armament
 * 14) Armour
 * 15) Aircraft

To use ability of the template to display the common features of a class from one central document, Wikipedia templates covering those variables that apply to the ship need to be created. For example, for the Invincible-class aircraft carrier, templates such as Template:Ship length box Invincible class aircraft carrier and Template:Ship aircraft box Invincible class aircraft carrier have been created.

The templates must use the following name structure:


 * Template:Variable box XXXX

where variable is the name of the parameter referred to, such as sensors for the sensors of the ship, complement for the complement etc and XXXX is a descriptor of the ship class, such as Invincible class aircraft carrier or Arleigh Burke class destroyer.

Following many of the template variables will be found a separate section "Individual ship". The intention of that section is to allow variations from the class unique to each ship to be covered in the table. For example, if one ship in a class has half its guns removed at a certain date, then "Individual ship" would be the place to cover that change.

In order to accomodate the traditions of the Wikipedia, the template can cope with both British and American English. This comes up at two points in the table: draught/draft and armour/armor. In order to tell the template which variant to use, two variables must be set. For the armour variable, the functionality is incorporated into "Ship table armour". To set the armour row not to appear the variable should still be set to "no". To set the armour row to appear with British spelling it should be set to "yes uk", and to set it to appear with American spelling it should be set to "yes us". For the draught variable, the functionality is implemented using "Draught", with the variable simply being set to "uk" or "us" as appropriate.

There is one other variation in the structure of the table: the variable "Ship table fate" can be set in two ways. Set it to status and the ship will have a status row in the table, and set it to fate and the ship will have a fate row instead.

The most simple part of the table covers the following variables:


 * 1) Ship image
 * 2) Ship caption
 * 3) Ship ordered
 * 4) Ship flag
 * 5) Ship laid down
 * 6) Ship launched
 * 7) Ship purchased
 * 8) Ship commissioned
 * 9) Ship decommissioned
 * 10) Ship in service
 * 11) Ship out of service
 * 12) Ship struck
 * 13) Ship homeport
 * 14) Ship motto
 * 15) Ship nickname

They are unique to each ship and thus should be entered as in a normal table. "Ship image" is the photo of the ship that appears at the top of the table and should use Wikipedia image markup. "Ship caption" is the caption for that image. "Ship flag" is the ensign/jack of the navy/ies that the ship serve(d) with and again should use the appropriate Wikipedia image markup.

For the variable "ship fate" a variety of templates have been created to provide consistency and linkage for ships. The variables defined include:


 * 1) active in service
 * 2) target
 * 3) sunk enemy action
 * 4) wrecked
 * 5) ordered
 * 6) building
 * 7) museum ship
 * 8) scrapped
 * 9) in reserve
 * 10) unknown

As with the class common feature templates, "ship fate" is followed by "individual ship" which can be used to flesh out the broad categories, such as when a ship was wrecked, where is a muesum ship, who built it etc.