Template:Election box US auto/doc
< Template:Election box US auto
Jump to navigation
Jump to search
Revision as of 08:03, 12 November 2018 by imported>Legoktm (document primary=yes)
| File:Edit-copy green.svg | This is a documentation subpage for Template:Election box US auto. It contains usage information, categories and other content that is not part of the original template page. |
| File:Lua-Logo.svg | This template uses Lua: |
Usage
Example: {{election box US auto|California|2016|United States Representative District 7}}
| Party | Candidate | Votes | % | |
|---|---|---|---|---|
| style="background-color: Template:Political party color; width: 5px;" | | Democratic | Ami Bera (Incumbent) | 152,133 | 51.2% |
| style="background-color: Template:Republican Party (US)/meta/color; width: 2px;" | | [[Republican Party (US)|Template:Republican Party (US)/meta/shortname]] | Scott R. Jones | 145,168 | 48.8% |
| Total votes | 297,301 | 100.0% | ||
| style="background-color: Template:Political party color" | | Democratic hold | |||
A {{election box}} template for US elections that automatically builds the table using tabular data from Commons.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| State | 1 | no description
| String | required |
| Year | 2 | Year the election took place
| Number | required |
| Contest | 3 | Name of the contest as specified in the tabular data
| String | required |
| Type | type | Type of election, can be "Primary"
| String | optional |
| Hold | hold | "held" if the same party held the seat, or "flip" if Democrats/Republicans switched.
| Unknown | optional |
| Gain party | gain | Name of party which gains the seat
| String | optional |
| Loser party | loser | Name of party that lost the seat
| String | optional |
| Primary | primary | Whether to include primary information in the same template
| String | optional |