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

From blackwiki
Jump to navigation Jump to search
imported>GoingBatty
m (General fixes, typo(s) fixed: ie → i.e. using AWB (11376))
Line 5: Line 5:
 
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=[[Brazil general election, 0001|General election 0001]]: Acre}}
 
{{Election box candidate with party link
 
{{Election box candidate with party link
   |party      = Labour Party (UK)
+
   |party      = ConLib
   |candidate  = Tony Blair
+
   |candidate  = Marchezan
 
   |votes      = 9,999
 
   |votes      = 9,999
   |percentage = 50.0
+
   |percentage = 36.8
   |change    = +10.0
+
   |change    = +4.4
 
}}
 
}}
 
{{Election box candidate with party link
 
{{Election box candidate with party link
   |party      = Conservative Party (UK)
+
   |party      = PTU
   |candidate  = Michael Howard
+
   |candidate  = Hoffmann
   |votes      = 9,999
+
   |votes      = 9,984
   |percentage = 50.0
+
   |percentage = 41.1
   |change    = +10.0
+
   |change    = -3.9
}}
 
{{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}}
 
 
 
===How to use===
 
 
 
====Basic====
 
There are three basic templates:
 
 
 
*{{tl|Election box begin}}
 
*{{tl|Election box candidate}}
 
*{{tl|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 <nowiki>|}</nowiki> at the end of the election box.  If you do place the <nowiki>|}</nowiki> it will be detected as an error by syntax-checking bots and will then be placed in the [[WP:WS|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:
 
<nowiki>
 
{{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}}
 
</nowiki>
 
 
 
Will create this:
 
{{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}}
 
 
 
====Party links====
 
See [[Template:Election box candidate with party link]] for usage and set-up.
 
 
 
====Majority and turnout====
 
Two further templates:
 
 
 
* {{tl|Election box majority}}
 
* {{tl|Election box turnout}}
 
 
 
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:
 
<nowiki>
 
...
 
{{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}}
 
</nowiki>
 
 
 
Will create this:
 
{{Election box begin |title=[[United Kingdom general election, 2005|General election 2005]]: Strangford}}
 
{{Election box candidate with party link
 
  |party      = Labour Party (UK)
 
  |candidate  = Tony Blair
 
  |votes      = 9,999
 
  |percentage = 50.0
 
  |change    = +10.0
 
}}
 
{{Election box candidate with party link
 
  |party      = Conservative Party (UK)
 
  |candidate  = Michael Howard
 
  |votes      = 9,999
 
  |percentage = 50.0
 
  |change    = +10.0
 
}}
 
{{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}}
 
 
 
====Election outcome====
 
Finally there are two templates:
 
 
 
* {{tl|Election box hold with party link}}
 
* {{tl|Election box gain with party link}}
 
 
 
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:
 
<nowiki>
 
...
 
{{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}}
 
</nowiki>
 
 
 
Will create this:
 
{{Election box begin |title=[[United Kingdom general election, 2005|General election 2005]]: Strangford}}
 
{{Election box candidate with party link
 
  |party      = Labour Party (UK)
 
  |candidate  = Tony Blair
 
  |votes      = 9,999
 
  |percentage = 50.0
 
  |change    = +10.0
 
}}
 
{{Election box candidate with party link
 
  |party      = Conservative Party (UK)
 
  |candidate  = Michael Howard
 
  |votes      = 9,999
 
  |percentage = 50.0
 
  |change    = +10.0
 
}}
 
{{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 hold with party link
 
  |winner    = Labour Party (UK)
 
  |swing      = +10.0
 
}}
 
{{Election box end}}
 
 
 
or this...
 
 
 
{{Election box begin |title=[[United Kingdom general election, 2005|General election 2005]]: Strangford}}
 
{{Election box candidate with party link
 
  |party      = Labour Party (UK)
 
  |candidate  = Tony Blair
 
  |votes      = 9,999
 
  |percentage = 50.0
 
  |change    = +10.0
 
 
}}
 
}}
{{Election box candidate with party link
 
  |party      = Conservative Party (UK)
 
  |candidate  = Michael Howard
 
  |votes      = 9,999
 
  |percentage = 50.0
 
  |change    = +10.0
 
}}
 
 
  {{Election box majority
 
  {{Election box majority
 
   |votes      = 9,999
 
   |votes      = 9,999
Line 220: Line 27:
 
  {{Election box turnout
 
  {{Election box turnout
 
   |votes      = 9,999
 
   |votes      = 9,999
   |percentage = 50.0
+
   |percentage = 81.2
   |change    = +10.0
+
   |change    = +5.4
}}
 
{{Election box gain with party link
 
  |winner    = Conservative Party (UK)
 
  |loser      = Labour Party (UK)
 
  |swing      = +10.0
 
 
  }}
 
  }}
 
{{Election box end}}
 
{{Election box end}}
 
Notes:
 
*The ''swing'' parameter represents [[Peter Snow]]'s [[Swingometer]] measure, i.e. 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 <code> &lt;!-- and --> </code>) 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===
 
{{List of Election Box Templates}}
 
 
===Blanks by country===
 
* [[Template:Election box/UK-blanks|United Kingdom]]
 
* [[Template:Election box/US blanks|United States]]
 
 
===Extensions===
 
*[[Template:Election FPTP begin]] As 1, but includes an additional column for expenditures. [[Bulkley Valley-Stikine|Example]]
 
*[[Template:Election box begin for list]] As 1, but better suited to list-based multi-member constituencies. [[London (European Parliament constituency)|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===
 
*[[Template:Compact election box]] A more compact box for first-past-the-post elections
 
 
<includeonly><!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
[[Category:Election and referendum infobox templates]]
 
 
[[ro:Format:Election box]]
 
</includeonly>
 

Revision as of 01:16, 8 October 2017

Use

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

General election 0001: Acre
Party Candidate Votes % ±%
style="background-color: Template:ConLib/meta/color; width: 5px;" | [[ConLib|Template:ConLib/meta/shortname]] Marchezan 9,999 36.8 +4.4
style="background-color: Template:PTU/meta/color; width: 5px;" | [[PTU|Template:PTU/meta/shortname]] Hoffmann 9,984 41.1 -3.9
Majority 9,999 50.0 +10.0
Turnout 9,999 81.2 +5.4