Bản mẫu:Election box US auto/doc

Bách khoa toàn thư mở Wikipedia

Cách sử dụng[sửa mã nguồn]

Cơ bản[sửa mã nguồn]

Ví dụ: {{election box US auto|California|2016|United States Representative District 7}} Lỗi Lua trong Mô_đun:Election_box_US_auto tại dòng 159: Không thể tìm thấy dữ liệu dạng bảng: California Elections/2016/chung/Candidates.tab.

Sơ bộ[sửa mã nguồn]

You can also include primary information in the same box. Example: {{election box US auto|California|2016|State Assembly Member District 65|primary=yes}}

Lỗi Lua trong Mô_đun:Election_box_US_auto tại dòng 159: Không thể tìm thấy dữ liệu dạng bảng: California Elections/2016/chung/Candidates.tab.

Tham khảo

Liên kết tự động[sửa mã nguồn]

The template automatically tries to create links to candidates if they have pages. If the candidate's exact name has an article, then it will further check if it is a redirect, and follow it if so. Some candidates have redirects to the articles about their election, so we won't follow redirects to articles with the word "elections" in them. If no article exists (or it was a redirect to the election page), then no link is created unless |redlinks=1 was passed.

Sometimes you want to manually control the link target, like in cases where there's a disambiguation page. You can do so by passing a parameter in the format of |<name> link=target. For example, if the name in the dataset is Bernard "Bernie" Sanders, you would use |Bernard "Bernie" Sanders link=Bernie Sanders.


A {{election box}} template for US elections that automatically builds the table using tabular data from Commons.

Tham số bản mẫu

Nên dùng bản mẫu này với các tham số đặt trên cùng một hàng.

Tham sốMiêu tảKiểuTrạng thái
State1

không có miêu tả

Ví dụ
California
Chuỗi dàibắt buộc
Year2

Year the election took place. Can also be a comma separated list of years for multiple boxes

Ví dụ
2016
Sốbắt buộc
Contest3

Name of the contest as specified in the tabular data

Ví dụ
United States Representative District 8
Chuỗi dàibắt buộc
Typetype

Type of election, can be "Primary"

Mặc định
"General"
Chuỗi dàitùy chọn
Holdhold

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

Ví dụ
held
Không rõtùy chọn
Gain partygain

Name of party which gains the seat

Ví dụ
Democratic
Chuỗi dàitùy chọn
Loser partyloser

Name of party that lost the seat

Ví dụ
Democratic
Chuỗi dàitùy chọn
Primaryprimary

Whether to include primary information in the same template

Mặc định
no
Ví dụ
yes
Chuỗi dàitùy chọn
no headingsno headings

Whether to disable automatic headings when multiple boxes are being generated (comma separated list of years)

Mặc định
no
Ví dụ
yes
Chuỗi dàitùy chọn