Template talk:Election box

From NSwiki, the NationStates encyclopedia.
(Redirected from Template:Election box)
Jump to: navigation, search

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


General Election 2005: City of Redmofo
Party Candidate Votes % ±%
Democratic Socialist Party Joseph Edwards 9,999 50.0 +10.0
Conservative Roger Visdaiga 9,999 50.0 +10.0
Majority 9,999 50.0 +10.0
Turnout 9,999 50.0 +10.0


How to use

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:

 {{Election box begin | title=[[Rolatian general election, 2005|General Election 2005]]: City of Redmofo}}
 {{Election box candidate|
   |party      = DSP
   |candidate  = Joseph Edwards
   |votes      = 9,999
   |percentage = 50.0
   |change     = +10.0
 }}
 {{Election box candidate|
   |party      = Conservative
   |candidate  = Roger Visdaiga
   |votes      = 9,999
   |percentage = 50.0
   |change     = +10.0
 }}
 {{Election box end}}
 

Will create this:

General Election 2005: City of Redmofo
Party Candidate Votes % ±%
DSP Joseph Edwards 9,999 50.0 +10.0
Conservative Roger Visdaiga 9,999 50.0 +10.0

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:

 {{Election box begin | title=[[Rolatian general election, 2005|General Election 2005]]: City of Redmofo}}
 {{Election box candidate with party link|
   |party      = Democratic Socialist Party (Rolatia)
   |candidate  = Joseph Edwards
   |votes      = 9,999
   |percentage = 50.0
   |change     = +10.0
 }}
 {{Election box candidate with party link|
   |party      = Conservative Party (Rolatia)
   |candidate  = Roger Visdaiga
   |votes      = 9,999
   |percentage = 50.0
   |change     = +10.0
 }}
 {{Election box end}}
 

Will create this:

General Election 2005: City of Redmofo
Party Candidate Votes % ±%
Democratic Socialist Party Joseph Edwards 9,999 50.0 +10.0
Conservative Roger Visdaiga 9,999 50.0 +10.0

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:

 ...
 {{Election box majority|
   |votes      = 9,999
   |percentage = 50.0
   |change     = +10.0
 }}
 {{Election box turnout|
   |votes      = 9,999
   |percentage = 50.0
   |change     = +10.0
 }}
 {{Election box end}}
 

Will create this:

General Election 2005: City of Redmofo
Party Candidate Votes % ±%
Democratic Socialist Party Joseph Edwards 9,999 50.0 +10.0
Conservative Roger Visdaiga 9,999 50.0 +10.0
Majority 9,999 50.0 +10.0
Turnout 9,999 50.0 +10.0


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:

 ...
 {{Election box hold with party link|
   |winner     = Democratic Socialist Party (Rolatia)
   |swing      = +10.0
 }}

 or...

 {{Election box gain with party link|
   |winner     = Conservative Party (Rolatia)
   |loser      = Democratic Socialist Party (Rolatia)
   |swing      = +10.0
 }}
 {{Election box end}}
 

Will create this:

General Election 2005: City of Redmofo
Party Candidate Votes % ±%
Democratic Socialist Party Joseph Edwards 9,999 50.0 +10.0
Conservative Roger Visdaiga 9,999 50.0 +10.0
Majority 9,999 50.0 +10.0
Turnout 9,999 50.0 +10.0
Democratic Socialist Party hold Swing +10.0

or this...


General Election 2005: City of Redmofo
Party Candidate Votes % ±%
Democratic Socialist Party Joseph Edwards 9,999 50.0 +10.0
Conservative Roger Visdaiga 9,999 50.0 +10.0
Majority 9,999 50.0 +10.0
Turnout 9,999 50.0 +10.0
Conservative gain from Democratic Socialist Party Swing +10.0

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 <!-- and --> ) 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.

Party Link Setup

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 Democratic Socialist Party (Rolatia)). 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 DSP).

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 Democratic Socialist Party (Rolatia).
  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 {{Election box metadata}} 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 ArticleName/meta/color. 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 <nowiki>#FF0000</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 ArticleName/meta/shortname sub-page.

Example

Proportional system

There is also a series of proportional sections - i.e. ones without candidates. Here is an example; this:

{{Proportional election box begin | title=[[Rolatian general election, 2005|General Election 2005]]: City of Redmofo}}
{{Proportional election party box with party link|
  |party      = Democratic Socialist Party (Rolatia)
  |votes      = 9,999
  |percentage = 50.0
  |change     = +10.0
}}
 {{Proportional election party box with party link|
  |party      = Conservative Party (Rolatia)
  |votes      = 9,999
  |percentage = 50.0
  |change     = +10.0
 }}
 {{Proportional election party box without party link|
  |party      = Independent Liberal
  |votes      = 9,999
  |percentage = 50.0
  |change     = +10.0
 }}
 {{Proportional election box majority|
   |votes      = 9,999
   |percentage = 50.0
   |change     = +10.0
 }}
 {{Proportional election box turnout|
   |votes      = 9,999
   |percentage = 50.0
   |change     = +10.0
 }}
 {{Election box gain with party link|
   |winner     = Conservative Party (Rolatia)
   |loser      = Democratic Socialist Party (Rolatia)
   |swing      = +10.0
 }}
{{Election box end}}
 

produces:

General Election 2005: City of Redmofo
Party Votes % ±%
Democratic Socialist Party 9,999 50.0 +10.0
Conservative 9,999 50.0 +10.0
Independent Liberal 9,999 50.0 +10.0
Majority 9,999 50.0 +10.0
Turnout 9,999 50.0 +10.0
Conservative gain from Democratic Socialist Party Swing +10.0

Comments

Well, I finally got it all ported over. What does everyone think? --Rolatia 19:50, 11 February 2006 (GMT)