Template talk:Election box

From Wikipedia, the free encyclopedia

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


Contents

[edit] How to use

[edit] 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=[[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

[edit] 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=[[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 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

However, this does rely on some additional setup for each party. See Party Link Setup below for more details.

[edit] 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: 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


[edit] 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.

[edit] Party Link Setup

[edit] 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 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 (eg red), and the shortname template will just contain the name of the party as you want it to appear on the link (eg 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.

[edit] 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 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 {{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.

[edit] Example

[edit] UK General Election, Blank Templates

Cut'n'paste one of these to get started. Each contains rows for the most common parties in that region, delete the ones that don't apply and add additional rows as required.

For results from previous elections it is customary to list candidates order by number of votes, for pending elections, candidates should be listed in alphabetical order by candidate's surname.

[edit] England

{{Election box begin | title=[[United Kingdom general election, 2005|General Election 2005]]: xxxxxx}}
{{Election box candidate with party link|
  |party      = Labour Party (UK)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Conservative Party (UK)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Liberal Democrats (UK)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = United Kingdom Independence Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Green Party of England and Wales
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate|
  |party      = 
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box majority|
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box turnout|
  |votes      = 
  |percentage = 
  |change     = 
}}
<!-- Uncomment this section (and delete which ever does not apply) when the results are in:
{{Election box hold with party link|
  |winner     = 
  |swing      = 
}}
{{Election box gain with party link|
  |winner     = 
  |loser      = 
  |swing      = 
}}
-->
{{Election box end}}
 

[edit] Northern Ireland

{{Election box begin | title=[[United Kingdom general election, 2005|General Election 2005]]: xxxxxx}}
{{Election box candidate with party link|
  |party      = Labour Party (UK)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Conservative Party (UK)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Liberal Democrats (UK)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Democratic Unionist Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Ulster Unionist Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Sinn Féin
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Social Democratic and Labour Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate|
  |party      = 
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box majority|
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box turnout|
  |votes      = 
  |percentage = 
  |change     = 
}}
<!-- Uncomment this section (and delete which ever does not apply) when the results are in:
{{Election box hold with party link|
  |winner     = 
  |swing      = 
}}
{{Election box gain with party link|
  |winner     = 
  |loser      = 
  |swing      = 
}}
-->
{{Election box end}}
 

[edit] Scotland

{{Election box begin | title=[[United Kingdom general election, 2005|General Election 2005]]: xxxxxx}}
{{Election box candidate with party link|
  |party      = Labour Party (UK)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Conservative Party (UK)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Liberal Democrats (UK)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Scottish National Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Scottish Socialist Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Scottish Green Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate|
  |party      = 
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box majority|
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box turnout|
  |votes      = 
  |percentage = 
  |change     = 
}}
<!-- Uncomment this section (and delete which ever does not apply) when the results are in:
{{Election box hold with party link|
  |winner     = 
  |swing      = 
}}
{{Election box gain with party link|
  |winner     = 
  |loser      = 
  |swing      = 
}}
-->
{{Election box end}}
 

[edit] United Kingdom

{{Election box begin | title=[[United Kingdom general election, 2005|General Election 2005]]: xxxxxx}}
{{Election box candidate with party link|
  |party      = Labour Party (UK)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Conservative Party (UK)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Liberal Democrats (UK)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Democratic Unionist Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Scottish National Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Ulster Unionist Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Plaid Cymru
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Sinn Féin
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Social Democratic and Labour Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = RESPECT The Unity Coalition
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = United Kingdom Independence Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Green Party of England and Wales
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Scottish Socialist Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Scottish Green Party
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box candidate with party link|
  |party      = Veritas (political party)
  |candidate  = 
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box majority|
  |votes      = 
  |percentage = 
  |change     = 
}}
{{Election box turnout|
  |votes      = 
  |percentage = 
  |change     = 
}}
<!-- Uncomment this section (and delete which ever does not apply) when the results are in:
{{Election box hold with party link|
  |winner     = 
  |swing      = 
}}
{{Election box gain with party link|
  |winner     = 
  |loser      = 
  |swing      = 
}}
-->
{{Election box end}}

[edit] List of Templates

  1. Template:Election box begin
  2. Template:Election box candidate
  3. Template:Election box candidate with party link
  4. Template:Election box majority
  5. Template:Election box turnout
  6. Template:Election box hold with party link
  7. Template:Election box gain
  8. Template:Election box gain with party link
  9. Template:Election box end
  10. Template:Election box metadata

[edit] Others

  1. Template:Election Summary Begin
  2. Template:Election Summary Party
  3. Template:Election Summary for parties with no article on Wikipedia.
  4. Template:end box

[edit] Extensions

[edit] Discussion

[edit] Templates need to move

Pages like Labour Party (UK)/meta/color should not be in the main namespace. If they are, then they will be treated as articles and show up in places like Special:Shortpages. Is there any reason for them not to all be moved to the template namespace since they are being used as templates? Angela. 12:26, Apr 26, 2005 (UTC)

Angela, is there something intrinsically wrong with them showing up on Special:Shortpages, they are intentionally short pages? I could add about 10k of comments to them if that would help ;-). Putting them in the Template namespace doesn't make them any longer and just, well... hides them. They are similar in nature to subpages like {{Wikipedia:Village pump (news)}} which clearly does not belong in the Template namespace. Just because they are referenced using the same syntax as a template does not mean that they are are, in any way, a template. They are content that is included and rendered in an article in the same way that {{Wikipedia:Village pump (news)}} is included in the {{Wikipedia:Village pump}} article. 80N 13:40, Apr 26, 2005 (UTC)
The difference is that these pages are very unlikely to be used by anything other than templates. The Village pump pages, however, are meant to be used seperately, and are being included like templates on WP:VP to have a central point to work with. Plus, pages in the Wikipedia: namespace don't show up as articles in the statistics. --Pidgeot (t) (c) (e) 20:27, 26 Apr 2005 (UTC)

[edit] Color vs Colour

Any reason why the American spelling of color/colour was chosen? Jooler 11:52, 28 Apr 2005 (UTC)

  • Yes:
    • The short answer is that these templates are not UK specific and so using British spelling didn't seem appropriate.
    • The long answer is that many North Americans that I've come across consider colour to be a mis-spelling and, to them, just plain wrong. On the other hand, most Brits consider color to be merely the American spelling of the word. I'm not going to speculate here on why that is the case, but in my experience, that's the way it is.
    • Given that the templates are not UK specific, they are more likely to be used for elections in other countries if they do not have a provincial flavour to them, hence I plumped for color rather than colour.
    • One other consideration was that the kind of Wikipedia editor that would be setting up this kind of page is likely to be more IT literate and will most likely be familiar with the html color attribute, and can see that this is consistent in that respect. The average Wikipedia editor, who is just using these templates does not even need to be aware of these pages, once they are set up for each party then the templates deal with all that (which is the whole point of this approach).
    • 80N 16:03, Apr 28, 2005 (UTC)
      • This is English Wikipedia, the spelling of colour is used in British English, Australian English, Hiberno-English, Indian English, Caribbean English, Hong Kong English New Zealand English, Malaysian English, South African English and Jamaican English etc. and more besides. I see no reason to favour American spellings in the international context when International English leans towards the British variety. Indeed Wikipedia accepts that British English can and should be used in international contexts. The fact that some Americans are ignorant of non-American spellings is a failing on their part and the ignorance should not be encouraged. Jooler 16:22, 28 Apr 2005 (UTC)
        • We have a manual of style that addresses this issue: WP:MOS#National_varieties_of_English. Summary: Because 80N, the initial author, chose United States English spellings, we stick with that, even though the initial author talked about the "Labour" party. ☺ Uncle G 23:34, 2005 Apr 28 (UTC)
          • I don't think the MoS is relevant in this context, but in any case it might not be relevant anymore as there seems to be some discussion about the /meta/color pages being innappropriate. Would it be possible for all of the party colours to be contained in a single template, so that easy comparison could be made? Jooler 23:46, 28 Apr 2005 (UTC)
            • As far as I know there is no way to reference just a section of a document for inclusion in another document, otherwise that would be a nice way of grouping these fragments together. To me, the ability to locate these page fragments is quite important, currently they are located by being named relative to the party that they belong to. 80N 10:55, Apr 29, 2005 (UTC)
            • The primary purpose of the /meta/color page is to supply the value of the HTML color attribute for rendering some text, line or background on a web-page. It is very definitely not a description of the chosen colour of each political party. For example, it would not be appropriate to describe the colour of the Labour party as #CC0000, but that is the value of /meta/color for that party. If a page fragment were needed that described the colour of the party then I would support using /meta/colour for that, but a page fragment that provides a value for the HTML color attribute must be called, if we are to be rational, /meta/color. 80N 10:55, Apr 29, 2005 (UTC)

[edit] Change in Proportion of Vote

Is the percentage change for the candidate, the party or either? For instance, a constituency I just edited has a candidate who has switched allegiance to a new party (that has not had candidates there before)? Should I put the candidate's change in votes based on his previous party? Possibly, in cases like this, we should put both to make it clear.

--Joe Llywelyn Griffith Blakesley talk contrib 13:18, 2005 May 6 (UTC)

  • I think it really has to refer to the party not the candidate. If the Conservative Party puts up a different candidate from one electio to the next then the change refers to the party's fortunes not the candidate's. If a Labour candidate defects and stands as an independent then the %age change should probably be recorded as N/A. 80N 17:26, May 6, 2005 (UTC)
That is what I assumed (and did accordingly put the candidate down as if he had no votes last election). I was a bit unsure though because this candidate is changing from one party to another and the parties aren't really rivals (that tend to stand aganist each other). There should really be rules on this though. Are you saying that all parties that haven't stood before should be `N/A'?--that doesn't seem to be the practice, but it does make a lot more sense IMO.
--Joe Llywelyn Griffith Blakesley talk contrib 17:36, 2005 May 6 (UTC)

[edit] Swing

Shouldn't there be some way of saying who the swing is too (as this isn't immediately obvious)?

Also, maybe "swing" should be linked to a definition of the term.

--13:18, 2005 May 6 (UTC)

  • Yes, I've been wondering about this. I think the swing should always be relative to the winning party and should be a positive number if they increased their majority and a negative number if their majority was reduced. In most cases this is relative to whichever party is in second place. If the second place party is different from that in the previous election then I'm not sure what to do. The concept of swing only really works with a two horse race. When there are three parties in contention I think there is (theoretically) a swing between each pair of parties. 80N 17:18, May 6, 2005 (UTC)
Exactly. As a swing can be between any two parties, when mentioning a swing, we should always say who the giver and receiver of the swing are (" swing: n from foo to bar"), otherwise it doesn't make sense.
--Joe Llywelyn Griffith Blakesley talk contrib 18:42, 2005 May 6 (UTC)
Whilst it might be nice to hope swing is always relative to the winning party, it often isn't. In reality, the creation of a 'percentage swing' figure is fairly misleading where there are three or more parties in contention. --Vamp:Willow 16:41, 11 May 2005 (UTC)

[edit] By-election results boxes

Is anyone able to produce result boxes for:

  • Seats where the party who won at the last general election regains the seat lost in a in between by-election? (e.g. Leicester South)
  • Seats where the by-election loss is duplicated at the general election? (e.g. Brent East)
  • Seats where the seat is gained from one party who won the last general election and another who won the by-election? (The only one I can think of to hand is Fermanagh & South Tyrone between 1979, the two 1981 by-elections and 1983)

Ideally I'd go for "treat the by-election as just another election", but this can cause confusion, especially when boundaries change and because gains/losses are traditionally measured against the last general election. Timrollpickering 14:34, 9 May 2005 (UTC)

  • The title is general purpose enough to enable both the event (general election, by-election, presidential election, whatever) and the constitency name to be entered. Constituencies do change names from time to time (Anglesea, for example) without any boundary changes. When there is a boundary change someone has to make a decision about whether this is the same constituency that just got a bit bigger/smaller or whether this is a brand new one. Look at the scottish constituencies for various ways this problem has been treated (Ayr, Carrick, and Cumnock (UK Parliament constituency)#Election results, Falkirk (UK Parliament constituency)#Election results). 80N 08:27, May 11, 2005 (UTC)

[edit] Number and proportion of ballots spoilt & campaign expenditures

Can we have this somewhere as it is quite interesting and it makes it clear why the turnout is greater than the sum of the votes for each candidate? I don't think there is any point in having the percentages for different types of spoiling (i.e.: unstamped, multiple votes, voter identifiable, unmarked or uncertain). --Joe Llywelyn Griffith Blakesley talk contrib 19:05, 2005 May 6 (UTC)

  • Easy enough to create one, I'll do it sometime if someone else doesn't get to it sooner. 80N 08:27, May 11, 2005 (UTC)
  • I have been adding this into the BC provincial electoral districts. Example here, it is not perfect (does not explicitly say the # of registered voters) but it does the job. I believe a more important issue that is not being addressed is the campaign expenditures for each candidate. This data can shed a whole bunch of light on a first-past-the-post election and affect analysis. I am going to try and work this into another column.-maclean25 04:20, 25 May 2005 (UTC)

[edit] Majority and Turnout Calculation

The rules for doing these (and other) calculations need to be made clearer; in fact, IMO, we should find a way to get the templates to do all the calculations automatically from the raw vote numbers, because editors will probably not stick to the rules.

For the percentages for change in majority and/or turnout, do we put:

  • the percentage change of the number, and/or
  • the percentage change of the proportion, and/or
  • the difference between the turnout percentages?

Also, is the turnout as a proportion of those registered and/or those eligible to register, and is the majority that of the incumbent and/or the winner? --Joe Llywelyn Griffith Blakesley talk contrib 19:05, 2005 May 6 (UTC)

"turnout" is the number who cast a ballot (whether counted or spoilt) devided by the total number of eligible (registered) voters. "majority" is the difference between the winner and the person who comes second. --Vamp:Willow 16:38, 11 May 2005 (UTC)

[edit] Metadata proposal

There's been considerable discussion about the partyName/meta/color pages and I think it's probably now time to put forward a proposal for renaming them.

[edit] Goals

  1. The purpose of these page fragments is to provide a way of referencing a piece of data about a subject (in this case a political party) based solely on the name of the article being referenced. This enables a template to have just one argument rather than two or three or more.
  2. A secondary purpose is to promote consistency. Any page that wants to include a piece of information about a subject can reference a single common source rather than picking some value that just seems right. For example, the colour of the labour party is #CC0000, but #FF0000 (red) can easily get used by editors who cannot find a correct value.
  3. Another goal is ease of maintenance. If the Labour party changes it's official colour from red to blue then only one page change is necessary rather than 650 or more.

[edit] Issues

In the discussions about this mechanism the following issues and questions have been raised:

  1. Should the /meta/color page be called /meta/colour?
  2. Should these pages be in the article namespace or the template namespace?
  3. Short pages such as these in the article namespace will be listed on Special:Shortpages.
  4. Other pages exist that already contain this information (eg Template:British politics/party colours/Labour contains bgcolor="#CC0000").

[edit] Proposal

Pages of this kind that contain non-parameterised information fragments that are intended to be included in the body of a main article should be, in general, named as follows:

Template:group/identifier(s)/attribute

In the case of political parties used by the Election box templates (inter alia) the pages should be named:

Template:Political party/articleName/attribute

For example:

  1. Template:Political party/Labour Party (UK)/color
  2. Template:Political party/Labour Party (UK)/shortName

Since searching of the Template namespace is not easy, an index page should be created at the group level listing all of the entries for that group and enumerate the attributes that are being used. eg Template:Political party might contain:

 Attributes:
   */color - the value for an html color attribute
   */shortName - the common name or abbreviation in a local context
  
 Members:
   /Labour Party (UK)
     /Labour Party (UK)/color
     /Labour Party (UK)/shortName

   /Conservative Party (UK)
     /Conservative Party (UK)/color
     /Conservative Party (UK)/shortName

In addition, the talk page of each referenced page should provide a link to each of the meta data pages for ease of reference and maintenance.

[edit] Impact

The existing Election box templates can easily be changed to use the new naming scheme. Approximately 30 meta data pages exist in the article namespace that would need to replicated under the new names before the Election box templates could be modified.

Other templates that duplicate this information, such as Template:British politics/party colours/Labour which contains bgcolor="#CC0000" should be modified to:

 bgcolor="{{Political party/Labour Party (UK)/color}}"
 

[edit] Discussion

This seems like a really good idea to me - I've created metadata for some results from the 1997 election that I was filling in today, and they've both been marked for speedy deletion. >:-( Should I be working differently for now, or is this a work in progress? Vashti 19:09, 8 May 2005 (UTC)

  • Seems like the speedy deletion guys are way too speedy. What's more, adding the speedy delete tag to the page really messes things up. All you can do is a) delete the speedy delete tag and b) add a note to the page's talk page that points to here. In theory they should be just as zealous about flagging up templates but I bet they aren't. Until the proposed changes are implemented I'd say carry on regardless. 80N

[edit] Crossing the floor

What to do when MPs etc. cross the floor? See Basingstoke (UK Parliament constituency).

James F. (talk) 09:38, 30 May 2005 (UTC)

  • An interesting situation. I think that firstly there should be a comment on the Basingstoke (UK Parliament constituency) page mentioning briefly what happened with a pointer to Andrew Hunter (British politician) for a more detailed explanation. Secondly it should be described as a Conservative hold not a gain from the DUP. This is supported by the BBC who also describe it as a Conservative hold. 80N 06:06, Jun 1, 2005 (UTC)

[edit] For SDP-Liberal Alliance candidates

I've created {{Election box candidate for alliance}} for use for the Alliance candidates in the 1983/1987 elections. It needed to be different from this one because whether the candidate is SDP or Liberal needs to be specified - see Newbury for it being used in action. -- Joolz 16:39, 24 Jun 2005 (UTC)

[edit] Initiative elections

I was hoping this box would be extensible enough to use for initiative / referendum elections, like California special election, 2005. Any thoughts about a new template for this use?

I don't think you'd be able to use the existing templates, but you should be able to come up with somethink uses the same structure and has a similar look and feel. It would be great to have some consistency of presentation. 80N 08:16, 10 November 2005 (UTC)


[edit] Help With Wikibox/table for House seating

Hi. I've been working on the Canadian electoral project and have made historical legislatures/ridings here in British Columbia my pet project. I'm trying to evolve a seating-plan table for the elections pages (e.g. British Columbia general election, 1952, British Columbia general election, 1903, etc, showing the "division" of the House, Govt on the left as is customary. I've worked out a basic template, having columns just for Govt member/party, Govt riding, Opp riding, and Opp member/party. The template is Template:LegislatureSeats. I'd originally thought about having the percentage/plurality showing, but these boxes are more about the composition of the House than the electoral returns themselves; another option was to show any cabinet/committee posts, but these shift throughout a sitting so would be hard to track.

The nut I'm trying to crack now is how to use the formatted/templated party colours in this template; I don't want it like in election box where the colour is its own column; and I can do it so the colour's in the first column; but I'd rather have it in the Ridings column; or, if it's going to be in the member/party column on the left, it should also be in the one on the right.

For now I'm inputting the background colours by hand/code. If someone understands the language of the colour templates and knows how to do what I'm asking please get back to me.Skookum1 20:13, 21 December 2005 (UTC)

[edit] Question

I am redoing a bunch of the Canadian Federal Ridings election results and I am using the end election box template. The only problem I have is that the end election template has a line break in it. This means that whenever I use it, it creates an extra line which just makes the final end box look bloated. I was wondernig if this done on purpose? Or should I fix it? Cheers --Omnieiunium 04:45, 3 January 2006 (UTC)

[edit] Created new templates but can't get them to work

From the 1920s to the 1970s, there were numerous Independent Republican candidates who stood in Northern Ireland constituencies. More often than not, these candidates were members of Sinn Féin, which was banned at various periods. I'd like to make a list of these candidates and as a step in that direction have created Template:Independent Republican (Ireland)/meta/color and Template:Independent Republican (Ireland)/meta/shortname. For some reason, I cannot get these to work on Fermanagh_and_South_Tyrone_(UK_Parliament_constituency) for example. Can anyone help?--Damac 08:57, 19 January 2006 (UTC)

[edit] Non-partisan (or no party needed) election box templates

I have added some election box templates for non-partisan elections or elections where all candidates are from the same party, such as U.S. party primaries:

Usage is the same as other election box templates, except minus any party parameters. (The standard {{Election box end}} template should be used in conjunction with these.)

For example:

 {{Election box begin no party
 |  title=Any State USA Party Primary, 2006
 }}
 {{Election box candidate no party
 |  candidate  = [[Jane Incumbent]]
 |  votes      = 1,000
 |  percentage = 66.7
 |  change     = 
 }}
 {{Election box candidate no party
 |  candidate  = [[Joe Challenger]]
 |  votes      = 500
 |  percentage = 33.3
 |  change     = 
 }}
 {{Election box turnout no party
 |  votes      = 1,500
 |  percentage = 100.0
 |  change     = 
 }}
 {{Election box end}}
 

Produces this:

Any State USA Party Primary, 2006
Candidate Votes % ±%
Jane Incumbent 1,000 66.7
Joe Challenger 500 33.3
Turnout 1,500 100.0


I have also created another template to use with the above no party templates:

For example:

 {{Election box begin no party
 |  title=Any State USA Party Primary, 2006
 }}
 {{Election box candidate no party with winner
 |  winner     = ✓
 |  candidate  = [[Jane Incumbent]]
 |  votes      = 1,000
 |  percentage = 66.7
 |  change     = 
 }}
 {{Election box candidate no party with winner
 |  winner     = 
 |  candidate  = [[Joe Challenger]]
 |  votes      = 500
 |  percentage = 33.3
 |  change     = 
 }}
 {{Election box turnout no party
 |  votes      = 1,500
 |  percentage = 100.0
 |  change     = 
 }}
 {{Election box end}}
 

Produces this:

Any State USA Party Primary, 2006
Candidate Votes % ±%
Jane Incumbent 1,000 66.7
Joe Challenger 500 33.3
Turnout 1,500 100.0


The winner parameter can be any symbol (or word) you choose. (See Tick (checkmark) for some possibilities.)

I welcome any suggestions or changes. — Bellhalla 15:45, 12 March 2006 (UTC)

[edit] Australian templates

I have just created {{Election box candidate AU party}} to use the Australian politics party colours templates listed at Wikipedia:WikiProject Australian politics. This is used instead of {{Election box candidate with party link}}, and should have a short name such as "Labor" or "Liberal" in the party field. Last year I also created {{Election box formal}}, {{Election box informal}}, {{Election box total}} and {{Election box 2pp}} to complete boxes for Australian elections (which have compulsory, preferential voting). JPD (talk) 10:33, 18 October 2006 (UTC)

[edit] Inline election boxes

I have added a set of election box style templates for inline usage. These are intended for cases where one wants to present a large number of results without having incredibly long pages generated, such as in U.S. state House of Representatives elections.

The templates are:

Usage is the similar to other election box templates with some changes.

[edit] Template Parameters

[edit] {{Election box inline begin}}

Use this template once for each table.

Parameters
type: the type of race, such as "District", "Place", "Seat", etc.
change: the previous election to which results are being compared, such as "from 2005", "from last election". The change parameter can be left blank and just Change will appear in the heading.

[edit] {{Election box inline incumbent}}

Use this template once for each race in the table.

Parameters
race: the name or the number of the district, place, or seat
party: as in above templates
incumbent: the current officeholder
status: the current incumbents status, such as "Running", "Retired", etc.
candidates: the number of candidates vying for this office

[edit] {{Election box inline candidate}} and {{Election box inline candidate with party link}}

Use this template once for each candidate in a race.

Parameters
The parameters for these are the same as {{election box candidate}} and {{election box candidate with party link}}

[edit] {{election box inline end}}

Use this template once at the end of each table.

[edit] Example

For example:

{{Election box inline begin
| type = Place
| change = from 2005
}}
{{Election box inline incumbent
| race = 1
| party = Republican Party (US)
| incumbent = [[John J. Incumbent]]
| status = Did not run
| candidates = 2
}}
{{Election box inline candidate with party link
|  party= Republican Party (US)
|  candidate  = [[James T. Nominee]]
|  votes      = 1500
|  percentage = 75.00
|  change     = +35.00
}}
{{Election box inline candidate
|  party= Write-In
|  candidate  = [[Mary Sue Challenger]]
|  votes      = 500
|  percentage = 25.00
|  change     = +25.00
}}
{{Election box inline incumbent
| race = 2
| party = Democratic Party (US)
| incumbent = [[Jennifer Contender]]
| status = reelected
| candidates = 1
}}
{{Election box inline candidate with party link
|  party= Democratic Party (US)
|  candidate  = [[Jennifer Contender]]
|  votes      = 2,000
|  percentage = 100.00
|  change     = +0.50
}}
{{election box inline end}}
 

Produces this:

Place Party Incumbent Status Party Candidate Votes % Change from 2005
1 Republican John J. Incumbent Did not run Republican James T. Nominee 1500 75.00 +35.00
Write-In Mary Sue Challenger 500 25.00 +25.00
2 Democratic Jennifer Contender reelected Democratic Jennifer Contender 2,000 100.00 +0.50

I welcome any suggestions or improvements. — Bellhalla 16:08, 18 December 2006 (UTC)