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

From blackwiki
Jump to navigation Jump to search
imported>Legoktm
(new page)
 
imported>Legoktm
(+{{lua}})
Line 1: Line 1:
{{Documentation subpage}}
+
{{Documentation subpage}}{{lua|Module:Election box US auto}}
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
== Usage ==
 
== Usage ==

Revision as of 02:20, 12 November 2018

Usage

Example: {{election box US auto|California|2016|United States Representative District 7}}


United States House of Representatives elections, 2016[1]
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.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
State1

no description

Example
California
Stringrequired
Year2

Year the election took place

Example
2016
Numberrequired
Contest3

Name of the contest as specified in the tabular data

Example
United States Representative District 8
Stringrequired
Typetype

Type of election, can be "Primary"

Default
"General"
Stringoptional
Holdhold

"held" if the same party held the seat, or "flip" if Democrats/Republicans switched.

Example
held
Unknownoptional
Gain partygain

Name of party which gains the seat

Example
Democratic
Stringoptional
Loser partyloser

Name of party that lost the seat

Example
Democratic
Stringoptional