Template:Election box candidate with party link/doc

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 below for more details.

{	"params": { "party": { "label": "Party", "description": "The article name of the relevant party", "example": "Labour Party (UK)", "type": "wiki-page-name", "required": true },		"candidate": { "label": "Candidate name", "type": "string", "required": true },		"votes": { "label": "Number of votes", "example": "9,999", "type": "number", "required": true },		"percentage": { "label": "% vote share", "example": "50.0", "type": "number", "required": true },		"change": { "label": "Vote share change", "description": "Number of percentage points more/less than the previous election.", "example": "+10.0", "type": "string", "required": true }	},	"description": "A more sophisticated effect in election results tables can be achieved using this template. This adds a link to the candidate's party and also adds a color tab to the left of the candidate. See Election box begin and Election box end. See this template's page for a new party.", "paramOrder": [ "party", "candidate", "votes", "percentage", "change" ],	"format": "inline" }

Party set up
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 (e.g. 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 (e.g. red), and the shortname template will just contain the name of the party as you want it to appear on the link (e.g. 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. E.g. 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