Difference between revisions of "Template:Election box/doc"

From blackwiki
Jump to navigation Jump to search
imported>Rrius
(removes unnecessary pipes from example)
imported>Rrius
(more of same; formatting: 2x heading-style (using Advisor.js))
Line 2: Line 2:
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
  
=== Use ===
+
===Use===
 
These Election box templates are for displaying a list of candidates and results for any election.  They produce tables like this:
 
These Election box templates are for displaying a list of candidates and results for any election.  They produce tables like this:
  
{{Election box begin | title=[[United Kingdom general election, 2005|General Election 2005]]: Strangford}}
+
{{Election box begin |title=[[United Kingdom general election, 2005|General Election 2005]]: Strangford}}
{{Election box candidate with party link|
+
{{Election box candidate with party link
 
   |party      = Labour Party (UK)
 
   |party      = Labour Party (UK)
 
   |candidate  = Tony Blair
 
   |candidate  = Tony Blair
Line 13: Line 13:
 
   |change    = +10.0
 
   |change    = +10.0
 
}}
 
}}
{{Election box candidate with party link|
+
{{Election box candidate with party link
 
   |party      = Conservative Party (UK)
 
   |party      = Conservative Party (UK)
 
   |candidate  = Michael Howard
 
   |candidate  = Michael Howard
Line 20: Line 20:
 
   |change    = +10.0
 
   |change    = +10.0
 
}}
 
}}
  {{Election box majority|
+
  {{Election box majority
 
   |votes      = 9,999
 
   |votes      = 9,999
 
   |percentage = 50.0
 
   |percentage = 50.0
 
   |change    = +10.0
 
   |change    = +10.0
 
  }}
 
  }}
  {{Election box turnout|
+
  {{Election box turnout
 
   |votes      = 9,999
 
   |votes      = 9,999
 
   |percentage = 50.0
 
   |percentage = 50.0
Line 65: Line 65:
  
 
Will create this:
 
Will create this:
{{Election box begin | title=[[United Kingdom general election, 2005|General Election 2005]]: Strangford}}
+
{{Election box begin |title=[[United Kingdom general election, 2005|General Election 2005]]: Strangford}}
{{Election box candidate|
+
{{Election box candidate
 
   |party      = Labour
 
   |party      = Labour
 
   |candidate  = Tony Blair
 
   |candidate  = Tony Blair
Line 73: Line 73:
 
   |change    = +10.0
 
   |change    = +10.0
 
}}
 
}}
{{Election box candidate|
+
{{Election box candidate
 
   |party      = Conservative
 
   |party      = Conservative
 
   |candidate  = Michael Howard
 
   |candidate  = Michael Howard
Line 96: Line 96:
 
  <nowiki>
 
  <nowiki>
 
  ...
 
  ...
  {{Election box majority|
+
  {{Election box majority
 
   |votes      = 9,999
 
   |votes      = 9,999
 
   |percentage = 50.0
 
   |percentage = 50.0
 
   |change    = +10.0
 
   |change    = +10.0
 
  }}
 
  }}
  {{Election box turnout|
+
  {{Election box turnout
 
   |votes      = 9,999
 
   |votes      = 9,999
 
   |percentage = 50.0
 
   |percentage = 50.0
Line 110: Line 110:
  
 
Will create this:
 
Will create this:
{{Election box begin | title=[[United Kingdom general election, 2005|General Election 2005]]: Strangford}}
+
{{Election box begin |title=[[United Kingdom general election, 2005|General Election 2005]]: Strangford}}
{{Election box candidate with party link|
+
{{Election box candidate with party link
 
   |party      = Labour Party (UK)
 
   |party      = Labour Party (UK)
 
   |candidate  = Tony Blair
 
   |candidate  = Tony Blair
Line 118: Line 118:
 
   |change    = +10.0
 
   |change    = +10.0
 
}}
 
}}
{{Election box candidate with party link|
+
{{Election box candidate with party link
 
   |party      = Conservative Party (UK)
 
   |party      = Conservative Party (UK)
 
   |candidate  = Michael Howard
 
   |candidate  = Michael Howard
Line 125: Line 125:
 
   |change    = +10.0
 
   |change    = +10.0
 
}}
 
}}
  {{Election box majority|
+
  {{Election box majority
 
   |votes      = 9,999
 
   |votes      = 9,999
 
   |percentage = 50.0
 
   |percentage = 50.0
 
   |change    = +10.0
 
   |change    = +10.0
 
  }}
 
  }}
  {{Election box turnout|
+
  {{Election box turnout
 
   |votes      = 9,999
 
   |votes      = 9,999
 
   |percentage = 50.0
 
   |percentage = 50.0
Line 148: Line 148:
 
  <nowiki>
 
  <nowiki>
 
  ...
 
  ...
  {{Election box hold with party link|
+
  {{Election box hold with party link
 
   |winner    = Labour Party (UK)
 
   |winner    = Labour Party (UK)
 
   |swing      = +10.0
 
   |swing      = +10.0
Line 155: Line 155:
 
  or...
 
  or...
  
  {{Election box gain with party link|
+
  {{Election box gain with party link
 
   |winner    = Conservative Party (UK)
 
   |winner    = Conservative Party (UK)
 
   |loser      = Labour Party (UK)
 
   |loser      = Labour Party (UK)
Line 164: Line 164:
  
 
Will create this:
 
Will create this:
{{Election box begin | title=[[United Kingdom general election, 2005|General Election 2005]]: Strangford}}
+
{{Election box begin |title=[[United Kingdom general election, 2005|General Election 2005]]: Strangford}}
{{Election box candidate with party link|
+
{{Election box candidate with party link
 
   |party      = Labour Party (UK)
 
   |party      = Labour Party (UK)
 
   |candidate  = Tony Blair
 
   |candidate  = Tony Blair
Line 172: Line 172:
 
   |change    = +10.0
 
   |change    = +10.0
 
}}
 
}}
{{Election box candidate with party link|
+
{{Election box candidate with party link
 
   |party      = Conservative Party (UK)
 
   |party      = Conservative Party (UK)
 
   |candidate  = Michael Howard
 
   |candidate  = Michael Howard
Line 179: Line 179:
 
   |change    = +10.0
 
   |change    = +10.0
 
}}
 
}}
  {{Election box majority|
+
  {{Election box majority
 
   |votes      = 9,999
 
   |votes      = 9,999
 
   |percentage = 50.0
 
   |percentage = 50.0
 
   |change    = +10.0
 
   |change    = +10.0
 
  }}
 
  }}
  {{Election box turnout|
+
  {{Election box turnout
 
   |votes      = 9,999
 
   |votes      = 9,999
 
   |percentage = 50.0
 
   |percentage = 50.0
 
   |change    = +10.0
 
   |change    = +10.0
 
  }}
 
  }}
  {{Election box hold with party link|
+
  {{Election box hold with party link
 
   |winner    = Labour Party (UK)
 
   |winner    = Labour Party (UK)
 
   |swing      = +10.0
 
   |swing      = +10.0
Line 197: Line 197:
 
or this...
 
or this...
  
{{Election box begin | title=[[United Kingdom general election, 2005|General Election 2005]]: Strangford}}
+
{{Election box begin |title=[[United Kingdom general election, 2005|General Election 2005]]: Strangford}}
{{Election box candidate with party link|
+
{{Election box candidate with party link
 
   |party      = Labour Party (UK)
 
   |party      = Labour Party (UK)
 
   |candidate  = Tony Blair
 
   |candidate  = Tony Blair
Line 205: Line 205:
 
   |change    = +10.0
 
   |change    = +10.0
 
}}
 
}}
  {{Election box candidate with party link|
+
  {{Election box candidate with party link
 
   |party      = Conservative Party (UK)
 
   |party      = Conservative Party (UK)
 
   |candidate  = Michael Howard
 
   |candidate  = Michael Howard
Line 212: Line 212:
 
   |change    = +10.0
 
   |change    = +10.0
 
  }}
 
  }}
  {{Election box majority|
+
  {{Election box majority
 
   |votes      = 9,999
 
   |votes      = 9,999
 
   |percentage = 50.0
 
   |percentage = 50.0
 
   |change    = +10.0
 
   |change    = +10.0
 
  }}
 
  }}
  {{Election box turnout|
+
  {{Election box turnout
 
   |votes      = 9,999
 
   |votes      = 9,999
 
   |percentage = 50.0
 
   |percentage = 50.0
 
   |change    = +10.0
 
   |change    = +10.0
 
  }}
 
  }}
  {{Election box gain with party link|
+
  {{Election box gain with party link
 
   |winner    = Conservative Party (UK)
 
   |winner    = Conservative Party (UK)
 
   |loser      = Labour Party (UK)
 
   |loser      = Labour Party (UK)
Line 246: Line 246:
 
*[[Template:Election box candidate for alliance]] As 3, with an additional "side" party. [[Newbury (UK Parliament constituency)#Elections_in_the_1980s|Example]]
 
*[[Template:Election box candidate for alliance]] As 3, with an additional "side" party. [[Newbury (UK Parliament constituency)#Elections_in_the_1980s|Example]]
  
=== See also ===
+
===See also===
 
*[[Template:Compact election box]] A more compact box for first-past-the-post elections
 
*[[Template:Compact election box]] A more compact box for first-past-the-post elections
  

Revision as of 05:00, 26 June 2011

Use

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

General Election 2005: Strangford
Party Candidate Votes % ±%
Labour Tony Blair 9,999 50.0 +10.0
Conservative Michael Howard 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:

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=[[United Kingdom general election, 2005|General Election 2005]]: Strangford}}
 {{Election box candidate
   |party      = Labour
   |candidate  = Tony Blair
   |votes      = 9,999
   |percentage = 50.0
   |change     = +10.0
 }}
 {{Election box candidate
   |party      = Conservative
   |candidate  = Michael Howard
   |votes      = 9,999
   |percentage = 50.0
   |change     = +10.0
 }}
 {{Election box end}}
 

Will create this:

General Election 2005: Strangford
Party Candidate Votes % ±%
Labour Tony Blair 9,999 50.0 +10.0
Conservative Michael Howard 9,999 50.0 +10.0

Party links

See Template:Election box candidate with party link for usage and set-up.

Majority and turnout

Two further templates:

can be added to record the majority and turnout figures for an election. (In this context, "majority" refers to the winning margin between the first and second placed candidates.)

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: Strangford
Party Candidate Votes % ±%
Labour Tony Blair 9,999 50.0 +10.0
Conservative Michael Howard 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     = Labour Party (UK)
   |swing      = +10.0
 }}

 or...

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

Will create this:

General Election 2005: Strangford
Party Candidate Votes % ±%
Labour Tony Blair 9,999 50.0 +10.0
Conservative Michael Howard 9,999 50.0 +10.0
Majority 9,999 50.0 +10.0
Turnout 9,999 50.0 +10.0
Labour hold Swing +10.0

or this...

General Election 2005: Strangford
Party Candidate Votes % ±%
Labour Tony Blair 9,999 50.0 +10.0
Conservative Michael Howard 9,999 50.0 +10.0
Majority 9,999 50.0 +10.0
Turnout 9,999 50.0 +10.0
Conservative gain from Labour 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.

List of templates

Election box begin

Election box candidate

Standard

Winning

Inline


Election summary

For parties without an article on Wikipedia.


Election box gain/hold/loss etc

Election box majority

Election box turnout

Election box total and related

Election box end


Blanks by country

Extensions

See also