Difference between revisions of "Template:SEO election box"

From Ballotpedia
Jump to: navigation, search
m (Text replace - "{{#if: {{{winner3|}}}|{{won}}'''{{{winner17}}}''' }}" to "{{#if: {{{winner17|}}}|{{won}}'''{{{winner17}}}''' }}")
 
Line 218: Line 218:
 
<td width="25px"> <span style="background-color:#{{#switch:{{lc:{{{party17|{{{1|}}}}}}}}|d|dem|democrat|democratic=00b|r|rep|repub|republican=b00|g|gr|grn|green=0b0|i|ind|independent=bbb|l|lib|libertarian=fd0|p|pf|peace|peace and freedom=000|t|tea=600|v|vt|vtprog|vermont progressive=f60|fff}};">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
 
<td width="25px"> <span style="background-color:#{{#switch:{{lc:{{{party17|{{{1|}}}}}}}}|d|dem|democrat|democratic=00b|r|rep|repub|republican=b00|g|gr|grn|green=0b0|i|ind|independent=bbb|l|lib|libertarian=fd0|p|pf|peace|peace and freedom=000|t|tea=600|v|vt|vtprog|vermont progressive=f60|fff}};">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
 
<td width="75px">{{{party17}}} </td>
 
<td width="75px">{{{party17}}} </td>
<td width="275px" style="text-align:center">{{#if: {{{winner3|}}}|{{won}}'''{{{winner17}}}''' }} {{#if: {{{candidate17|}}}|{{{candidate17}}}}} {{#ifeq: {{{Inc17}}}|Y|<small>'''''Incumbent'''''</small>}}</td>
+
<td width="275px" style="text-align:center">{{#if: {{{winner17|}}}|{{won}}'''{{{winner17}}}''' }} {{#if: {{{candidate17|}}}|{{{candidate17}}}}} {{#ifeq: {{{Inc17}}}|Y|<small>'''''Incumbent'''''</small>}}</td>
 
<td width="75" style="text-align:center">{{#if:{{{percent17|}}}|{{{votes17}}}%|{{#expr:{{#expr:({{{votes17|0}}} / ({{{votes1|0}}} + {{{votes2|0}}} + {{{votes3|0}}} + {{{votes4|0}}} + {{{votes5|0}}} + {{{votes6|0}}} + {{{votes7|0}}} + {{{votes8|0}}} + {{{votes9|0}}} + {{{votes10|0}}} + {{{votes11|0}}} + {{{votes12|0}}} + {{{votes13|0}}} + {{{votes14|0}}} + {{{votes15|0}}} + {{{votes16|0}}} + {{{votes17|0}}} + {{{votes18|0}}} + {{{votes19|0}}} + {{{votes20|0}}} + {{{votes21|0}}} + {{{votes22|0}}} + {{{votes23|0}}} + {{{votes24|0}}} + {{{votes25|0}}} + {{{votes26|0}}} + {{{votes27|0}}} + {{{votes28|0}}} + {{{votes29|0}}} + {{{votes30|0}}}))round3}}  * 100}}%}}</td>
 
<td width="75" style="text-align:center">{{#if:{{{percent17|}}}|{{{votes17}}}%|{{#expr:{{#expr:({{{votes17|0}}} / ({{{votes1|0}}} + {{{votes2|0}}} + {{{votes3|0}}} + {{{votes4|0}}} + {{{votes5|0}}} + {{{votes6|0}}} + {{{votes7|0}}} + {{{votes8|0}}} + {{{votes9|0}}} + {{{votes10|0}}} + {{{votes11|0}}} + {{{votes12|0}}} + {{{votes13|0}}} + {{{votes14|0}}} + {{{votes15|0}}} + {{{votes16|0}}} + {{{votes17|0}}} + {{{votes18|0}}} + {{{votes19|0}}} + {{{votes20|0}}} + {{{votes21|0}}} + {{{votes22|0}}} + {{{votes23|0}}} + {{{votes24|0}}} + {{{votes25|0}}} + {{{votes26|0}}} + {{{votes27|0}}} + {{{votes28|0}}} + {{{votes29|0}}} + {{{votes30|0}}}))round3}}  * 100}}%}}</td>
 
<td width="100" style="text-align:center">{{formatnum:{{{votes17|0}}}}}</td>
 
<td width="100" style="text-align:center">{{formatnum:{{{votes17|0}}}}}</td>

Latest revision as of 12:51, 18 October 2013

{{{Office}}}, {{{year}}}
Party Candidate Vote % Votes
Total Votes 0
[edit] Template-info.png Template documentation

This is a usage page for the {{SEO election box}}.

The election box template is to be used for general elections only. For the primary election box, see {{SEO primary election box/doc}}

There are two main items that compute automatically:

  • Total votes
  • Vote %

If the parameters are appropriately filled in, then those pieces of information will be entered automatically by the template.

Usage

Here is the basic code to copy and fill in:


{{SEO election box
|year =
|Office= 
|party1=
|party2=
|winner1 =
|Inc1 = 
|candidate2 = 
|votes1 = 
|votes2 = 
}}

There are as many as 30 candidates that can be added to an election box. Quite simply, there are three parameters needed per candidate:

  1. party1
  2. candidate1
  3. votes1

For each subsequent candidate, it would change to:

  1. party2
  2. candidate2
  3. votes2

and...

  1. party3
  2. candidate3
  3. votes3

etc...

If the candidate is the winner, then substitute: winner3 for candidate3

Other important notes

  • Add a reference link using "ref = [link]"
  • The winner should always go first, with subsequent candidates in order based on number of votes.
  • If a candidate is an incumbent, simply type "Inc3=Y" and alter the "3" based on which candidate it is.
So if candidate5 is the incumbent, then "Inc5=Y"
  • If when you build the table you want to make it collapsed from the start, enter "Collapse=Yes"

Here is the code with explanations.

{{SEO election box
|year = The year of the election
|Office= The title of the election, such as "Governor of Arkansas"
|party1=The political party, such as "Democratic" or "Republican"
|winner1 = Name of the winner
|Inc1 = If the candidate is an incumbent, put "Y"
|candidate2 = Name of a candidate
|votes1 = Number of votes for candidate/winner 1. should be entered without commas, like "230424"
|votes2 = Number of votes for candidate/winner 2. should be entered without commas, like "230424"
|ref = [The reference link]
}}

Here is an example implemented:

{{SEO election box
|year = 2012
|Office=Governor of the Moon
|party1=Democratic
|winner1 = E Person 1
|votes1 = 800
|Inc1 = Y
|party2=Republican
|candidate2 = E Person 2
|votes2 = 600
|ref = [http://www.ballotpedia.org Ballotpedia]
}}
Governor of the Moon, 2012
Party Candidate Vote % Votes
     Democratic Green check mark transparent.pngE Person 1 Incumbent 57.1% 800
     Republican E Person 2 42.9% 600
Total Votes 1,400
Election Results Via: Ballotpedia

Here is the code for a box with four candidates.

{{SEO election box
|year = 2006
|Office=A Test Election
|party1=Democratic
|party2=Republican
|party3=Libertarian
|party4=Democratic
|winner1 = C Person 1
|Inc3 = Y
|winner2= C Person 2
|candidate3 = C Person 3
|candidate4 = C Person 4
|votes1 = 1500
|votes2 = 1150
|votes3 = 900
|votes4 = 800
|ref = [http://www.ballotpedia.org Ballotpedia]
}}
A Test Election, 2006
Party Candidate Vote % Votes
     Democratic Green check mark transparent.pngC Person 1 34.5% 1,500
     Republican Green check mark transparent.pngC Person 2 26.4% 1,150
     Libertarian C Person 3 Incumbent 20.7% 900
     Democratic C Person 4 18.4% 800
Total Votes 4,350
Election Results Via: Ballotpedia