Bản mẫu:Election box US auto
Bản mẫu này sử dụng Lua: |
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ố | Miêu tả | Kiểu | Trạng thái | |
---|---|---|---|---|
State | 1 | không có miêu tả
| Chuỗi dài | bắt buộc |
Year | 2 | Year the election took place. Can also be a comma separated list of years for multiple boxes
| Số | bắt buộc |
Contest | 3 | Name of the contest as specified in the tabular data
| Chuỗi dài | bắt buộc |
Type | type | Type of election, can be "Primary"
| Chuỗi dài | tùy chọn |
Hold | hold | "held" if the same party held the seat, or "flip" if Democrats/Republicans switched.
| Không rõ | tùy chọn |
Gain party | gain | Name of party which gains the seat
| Chuỗi dài | tùy chọn |
Loser party | loser | Name of party that lost the seat
| Chuỗi dài | tùy chọn |
Primary | primary | Whether to include primary information in the same template
| Chuỗi dài | tùy chọn |
no headings | no headings | Whether to disable automatic headings when multiple boxes are being generated (comma separated list of years)
| Chuỗi dài | tùy chọn |