Template:Election box/doc

These Election box templates are for displaying a list of candidates and results for any election. They produce tables like this:

Basic
There are three basic templates Template:Election box begin, Template:Election box candidate and Template:Election box end. The begin and end templates start and end a table with appropriate columns and formatting. The candidate template is used once for each candidate and contributes a row to the table.

When using this template please use the election box end template rather than simply inserting |} at the end of the election box. If you do place the |} it will be detected as an error by syntax-checking bots and will then be placed in the syntax cleanup project queue and will need to be fixed by someone. Having fixed a few hundred already, it is becoming somewhat repetitive.

For example:

Will create this:

Party Links
A more sophisticated effect can be achieved using Template:Election box candidate with party link. This adds a link to the candidate's party and also adds a color tab to the left of the candidate. For example:

For example:

Will create this:

However, this does rely on some additional setup for each party. See Party Link Setup below for more details.

Majority and Turnout
Two further templates can be added to record the majority and turnout figures for an election.

For example: ...

Will create this:

Election outcome
Finally there are two templates that can be used to summarize the outcome of an election, in terms of whether the incumbent holds the seat or whether it is lost to another party.

For example: ...

or...

Will create this:

or this...

Notes:
 * The swing parameter represents Peter Snow's Swingometer measure, ie the percentage change (or swing) in the vote since the last election.
 * When preparing the tables in advance of an election, it may be convenient to include these two templates but commented out (using ) until the outcome is known.
 * Potentially there is a need for versions of these templates that do not have the party link mechanism. However, it can be argued that any party that has a successful candidate deserves an article about them and the full /meta/color treatment.  The one obvious exception to this is, of course, independent candidates, who won't actually have a party.  If / when there's a need, just create a non party link version of these templates.

Overview
In order to use the template Template:Election box candidate with party link it is necessary to do some a little bit of setup for each party in the election. This involves creating two simple templates for the article that you will be linking to (eg Labour Party (UK)). These contain the identifying color of the party and the short name that will be used as the link caption (as the full wikipedia page name will probably not be suitable).

The two templates that you will need to create are:
 * Template:ArticleName/meta/color
 * Template:ArticleName/meta/shortname

The color template will just contain the party's identifying color (eg red), and the shortname template will just contain the name of the party as you want it to appear on the link (eg Labour).

You should also add something to the main article's talk page to indicate that these two templates exist. There is a template Template:Election box metadata that can be used to do this.

Step by step instructions
Following are some easy step-by-step instructions for adding the two sub-pages:


 * 1) First, go to the article about the party that you want to set up. Eg Labour Party (UK).
 * 2) Click on the discussion tab to get to article's talk page.
 * 3) Click on the edit this page tab to start editing the page.
 * 4) Add the text   somewhere on the page.  This will create a section on the page that provides links to the meta pages, however they don't exist yet.
 * 5) Save the page.
 * 6) Click on the red link to the page .  As this page does not yet exist, this will take you directly to the page creation screen.
 * 7) Enter just the identifying color of the party. This can be a color name, such as red or an RGB code such as #FF0000.  If you use an RGB code you will need to type it as &lt;nowiki>#FF0000&lt;/nowiki> otherwise it will be treated as a list element.
 * 8) Put the text For Template:Election box in the Edit Summary field (otherwise someone will flag it for speedy deletion)!
 * 9) Save the page.
 * 10) Repeat the previous four steps for the  sub-page.

Example

 * Talk:Labour Party (UK)
 * Template:Labour Party (UK)/meta/color
 * Template:Labour Party (UK)/meta/shortname

UK
See /UK-blanks

Extensions

 * Template:Election FPTP begin As 1, but includes an additional column for expenditures. Example
 * Template:Election box begin for list As 1, but better suited to list-based multi-member constituencies. Example
 * Template:Election box candidate for alliance As 3, with an additional "side" party. Example