Template:NZ party list candidate/doc

Basic structure
A party list displayed using these templates needs to have, in order, these three components:
 * , which starts the table and creates the headings.
 * 1) As many instances of as there are candidates on the list, with various parameters (which look like ) defined in each one.
 * 2) The code, which ends the table.

Examples
A party list with one person on it might look like this:







This would produce:

To add further candidates, just add duplicate the template (i.e., everything in green in the example, including the after the last parameter). For example:









This would produce:

The examples above place each parameter on a new line, but note that it's also possible to "compress" them for the sake of space. This may make long lists easier to manage. For example, the above list could also be created with:





For a collapsed table, use collapsed in the









This would produce:

Parameters
There are various different parameters that can be used in a candidate's entry. Generally, it's probably safest if only parameters which are actually required are included. (That is, don't leave blank parameters (like ) in the code — hopefully it shouldn't matter, but there's the potential for problems.) Parameters should be entered exactly, as things like capitalisation can matter. The list of parameters is:

Things that shouldn't need to be done manually in the parameters include:
 * Putting the names of incumbent MPs in bold. People for whom  or   should get this automatically. (Links, however, are not automatic, since they can take all sorts of different forms.)
 * Making the (Former MP) tag look like such. Just specifying  should do it.
 * Linking electorates. If the electorates held by incumbent MPs are given, links to electorate pages should be automatic. If a candidate is shown as contesting an electorate, the template should a) automatically detect whether a candidates-by-electorate page exists under the normal naming convention; and b) link to it if one does exist, or link to the plain electorate page if it doesn't.
 * Calculating and specifying the difference between a candidate's current rank and their previous rank. Just provide the two values, and the difference between them should be calculated automatically.
 * Adding colours and symbols to indicate results (once they're known). Just specify the result (e.g. ) and the rest should take care of itself. (See the 2008 page for an example of this in action.)
 * Sort keys. In theory: all candidates should sort properly by last name; electorates should sort without initial-macron names like Ōhariu causing problems; electorate/list/former incumbencies should sort in that order; and electorate/list/later/defeated results should sort in that order.

Optional columns
There are three options which allow certain columns of the table to be switched on or off, depending on preferences. To do this, two things must be done: firstly, the header template must have the appropriate parameter added and set; and secondly, every candidate in the table must have the relevant parameters for the column in question set to appropriate values. (Changing the header without making sure the candidate entries are all set up appropriately, or vice versa, will create a mess.)

For example (with differences from the default bold and underlined):





This would produce: