This template is one of many available for presenting election results; however, the eventual goal is that this template becomes the standard used throughout Wikipedia.

Usage edit

Important: While most of the template parameters are optional, if you use a field for one candidate, use that field for all candidates.

Header edit

title= The name for an election

year= The year an election took place; this occupies the top-left corner of the table. This field should always be used.

width= The width of the table — default value is 55%. If a page has multiple election boxes, make sure to keep the width consistent throughout.

Candidate rows edit

Note that template parameters in this section have an "n" in their name. This should be substituted with the number of the candidate in order of appearance in the template. Up to 20 candidates are supported.

Political party

In non-partisan elections, political parties can be left out at the discretion of the editor.

partyn= For "prepared" political parties. For example, if partyn is defined as "Democratic Party (US)", the color defined at #F8F9FA is used and the short name defined at {{Democratic Party (US)/meta/shortname}} is used.

To use a custom political party and color:

partynname= for the name of a political party (linked at the user's discretion).

partyncolor= for the color of a political party. Hexadecimal codes or color names can be used. This value defaults to gray.

Candidate name

In elections that involve only political parties, the candidate name column can be left out.

candidaten= The name of the candidate, linked at the user's discretion.

Winners should be bolded and incumbents should be italicized.

Votes received

votesn= The counted number of votes received. Example value: 9,015

percentn= The percentage of votes received. Example value: 54%

percentchangen= The percent change in votes received by the party (or the person for independents) in the previous election. Example value: +1.5%

Candidate rows (auxiliary) edit

Running mates

Individual running mates should only be added to an election box in situations where the running mate's candidacy is substantially different; for example, if there is a difference in political parties or votes received.

runningmaten= The name of the running mate.

runningmate-partyn= The political party of the running mate.

runningmate-partynname= For custom political parties (see above).

runningmate-partyncolor= For custom political parties (see above).

runningmate-votesn= Votes received.

runningmate-percentn= Percent of votes received.

runningmate-percentchangen= Percent change of votes received.

Party votes

For mixed-member proportional representation elections, such as those in New Zealand.

partyvotesn= The number of votes received by a party.

partypercentn= The percent of votes received by a party.

partypercentchangen= The percent change of votes received by a party.

Majority edit

The majority in an election is the difference in votes received between first place and second place.

majority= The difference in counted votes between first and second place.

majoritypercent= The percent difference between first and second place.

majoritypercentchange= The percent change between first and second place compared to the previous election.

For when running mates are involved: runningmate-majority=, runningmate-majoritypercent, and runningmate-majoritypercentchange

For when party votes are involved: partymajority=, partymajoritypercent=, and partymajoritypercentchange=

Turnout edit

turnout= The number of voters in an election.

turnoutpercent= The percent of voter turnout, compared to the electorate (number of people eligible to vote) as a whole.

turnoutpercentchange= The percent change in an election compared to the prior election.

Winning political party edit

winner= The winning political party. In legislative elections, this is the political party that won the most seats.

winnername= The name of the winning political party (for custom political parties; see above).

winnercolor= The color of the winning political party (for custom political parties; see above).

If the winner gained control from a losing party, be sure to add a "loser" parameter, whether lower= or losername= with losercolor=.

Swing edit

While a standard in Commonwealth politics, swing is not typically calculated for United States elections. For that reason, it is optional.

swing= The percent swing in an election.

swingchange= The percent change in swing in an election.

Examples edit

US House election edit

2002 New Jersey's 13th congressional district
PartyCandidateVotes%±%
 DemocraticBob Menendez72,60578%−1%
 RepublicanJames Geron16,85218%−1%
 GreenPat Henry Faulkner1,1951%
 Anti-Corruption DoctorEsmat Zaklama7401%
 Pro Life ConservativeDick Hester7321%
 Politicians are CrooksHerbert H. Shaw5731%
Majority55,75360%0
 Democratic hold
{{Election
| title = {{ushr|New Jersey|13|}}
| year = [[U.S. House election, 2002|2002]]

| candidate1 = '''''[[Bob Menendez]]'''''
| party1 = Democratic Party (US)
| votes1 = 72,605
| percent1 = 78%
| percentchange1 = −1%

| candidate2 = [[James Geron]]
| party2 = Republican Party (US)
| votes2 = 16,852
| percent2 = 18%
| percentchange2 = −1%

| candidate3 = [[Pat Henry Faulkner]]
| party3 = Green Party of the United States
| votes3 = 1,195
| percent3 = 1%
| percentchange3 = —

| candidate4 = [[Esmat Zaklama]]
| party4name = Anti-Corruption Doctor
| votes4 = 740
| percent4 = 1%
| percentchange4 = —

| candidate5 = [[Dick Hester]]
| party5name = Pro Life Conservative
| votes5 = 732
| percent5 = 1%
| percentchange5 = —

| candidate6 = [[Herbert H. Shaw]]
| party6name = Politicians are Crooks
| votes6 = 573
| percent6 = 1%
| percentchange6 = —

| majority = 55,753
| majoritypercent = 60%
| majoritypercentchange = 0

| winner = Democratic Party (US)
}}

New Zealand Parliament election edit

1999 New Zealand general election: Maungakiekie
PartyCandidateVotes%Party votes%
 LabourMark Gosche12,46944.4913,23446.44%
 NationalBelinda Vernon9,95735.53%7,87827.65%
 AllianceMatt Robson2,0967.48%1,8916.64%
 GreenJon Carapiet9643.44%1,1834.15%
 ACTAngus Ogilvie7742.76%2,2027.73%
 NZ FirstGilbert Myles7342.62%8102.84
 Future NZJason Keiller3871.38%
 Christian HeritageMary Paki3131.12%
 IndependentSue Henry1520.54%
 Natural LawGraeme Lodge730.26%
 IndependentTony Cranston670.24%
 RepublicanBrian Freeth400.14%
 United NZ1690.59%
 Unsuccessful parties11273.96
Majority2,5128.96%
 Labour gain from National
{{Election
| title = [[New Zealand general election, 1999|New Zealand general election]]: Maungakiekie
| year = [[New Zealand general election, 1999|1999]]

| party1 = New Zealand Labour Party
| candidate1 = '''[[Mark Gosche]]'''
| votes1 = 12,469
| percent1 = 44.49 
| partyvotes1 = 13,234
| partypercent1 = 46.44%

| party2 = New Zealand National Party
| candidate2 = ''[[Belinda Vernon]]''
| votes2 = 9,957
| percent2 = 35.53% 
| partyvotes2 = 7,878
| partypercent2 = 27.65%

| party3 = Alliance (New Zealand political party)
| candidate3 = [[Matt Robson]]
| votes3 = 2,096
| percent3 = 7.48%
| partyvotes3 = 1,891
| partypercent3 = 6.64%

| party4 = Green Party of Aotearoa New Zealand
| candidate4 = Jon Carapiet
| votes4 = 964
| percent4 = 3.44%
| partyvotes4 = 1,183
| partypercent4 = 4.15%

| party5 = ACT New Zealand
| candidate5 = Angus Ogilvie
| votes5 = 774
| percent5 = 2.76% 
| partyvotes5 = 2,202
| partypercent5 = 7.73%

| party6 = New Zealand First
| candidate6 = Gilbert Myles
| votes6 = 734
| percent6 = 2.62%
| partyvotes6 = 810
| partypercent6 = 2.84


| party7name = [[Christian Democrat Party (New Zealand)|Future NZ]]
| party7color = purple
| candidate7 = Jason Keiller
| votes7 = 387
| percent7 = 1.38%
| partyvotes7 = —
| partypercent7 = —

| party8 = Christian Heritage Party of New Zealand
| candidate8 = Mary Paki
| votes8 = 313
| percent8 = 1.12%
| partyvotes8 = —
| partypercent8 = —
 
| party9 = Independent politician
| candidate9 = Sue Henry
| votes9 = 152
| percent9 = 0.54%
| partyvotes9 = —
| partypercent9 = —

| party10 = Natural Law Party of New Zealand
| candidate10 = Graeme Lodge
| votes10 = 73
| percent10 = 0.26%
| partyvotes10 = —
| partypercent10 = —

| party11 = Independent (politician)
| candidate11 = Tony Cranston
| votes11 = 67
| percent11 = 0.24%
| partyvotes11 = —
| partypercent11 = — 

| party12name = [[New Zealand Republican Party (1995)|Republican]]
| party12color = red
| candidate12 = Brian Freeth
| votes12 = 40
| percent12 = 0.14%
| partyvotes12 = —
| partypercent12 = — 

| party13 = United New Zealand
| candidate13 = —
| votes13 = —
| percent13 = —
| partyvotes13 = 169
| partypercent13 = 0.59%

| party14name = Unsuccessful parties
| party14color = white
| candidate14 = —
| votes14 = —
| percent14 = —
| partyvotes14 = 1127
| partypercent14 = 3.96

| majority = 2,512
| majoritypercent = 8.96%

| winner = New Zealand Labour Party
| loser = New Zealand National Party
}}


Microformats edit

hCalendar edit

The HTML mark-up produced by this template includes an hCalendar microformat that makes event/date details readily parsable by computer programs. This aids tasks such as the cataloguing of articles and maintenance of databases. For more information about the use of microformats on Wikipedia, please visit the Microformat WikiProject.

Classes used

The HTML classes of this microformat include:

  • attendee
  • description
  • dtend
  • dtstart
  • location
  • summary
  • url
  • vevent
Please do not rename or remove these classes
nor collapse nested elements which use them.

hCard edit

The HTML markup produced by this template includes an hCard microformat, which makes the person's name parsable by computers, either acting automatically to catalogue articles across Wikipedia or via a browser tool operated by a reader, to (for example) add the subject to an address book. For more information about the use of microformats on Wikipedia, please see the microformat project.

To include a URL, use {{URL}}.

Classes edit

The hCard in this template uses at least some of these HTML classes:

  • agent
  • family-name
  • fn (required)
  • given-name
  • honorific-prefix
  • honorific-suffix
  • n
  • nickname
  • org
  • url
  • vcard

Please do not rename or remove these classes nor collapse nested elements which use them.

See also edit