Template:Infobox election: Difference between revisions

From Chalo Chatu, Zambia online encyclopedia
Jump to navigationJump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
{| class="infobox vevent" style="width:22em; line-height:1.5em;"
{| class="infobox vevent" style="width:22em; line-height:1.5em; font-size: 90%;"
|+ {{#if:{{{election_name|}}}|{{{election_name}}}}}
|+ style="font-size: 110%; font-weight: bold; text-align: center;" | {{{election_name|Election}}}
|-
! style="text-align:center;" | {{#if:{{{type|}}}|{{ucfirst:{{{type}}}}} election}}
|-
| style="text-align:center;" | {{#if:{{{election_date|}}}|{{{election_date}}}}}
{{#if:{{{country|}}}|
|-
|-
{{#if:{{{type|}}}|! style="text-align:center;" colspan="2" | {{{type}}} election}}
{{#if:{{{election_date|}}}|{{!}}-{{!}}
! style="text-align:center;" colspan="2" | {{{election_date}}}}}
{{#if:{{{country|}}}|{{!}}-{{!}}
! Country
! Country
| {{{country}}}
{{!}} style="text-align:center;" | {{{country}}}}}
}}
{{#if:{{{turnout|}}}|{{!}}-{{!}}
{{#if:{{{turnout|}}}|
|-
! Turnout
! Turnout
| {{{turnout}}}
{{!}} style="text-align:center;" | {{{turnout}}}}}
}}
{{#if:{{{registered|}}}|{{!}}-{{!}}
{{#if:{{{registered|}}}|
|-
! Registered voters
! Registered voters
| {{{registered}}}
{{!}} style="text-align:center;" | {{{registered}}}}}
}}
{{#if:{{{previous_link|}}}|{{!}}-{{!}}
{{#if:{{{previous_year|}}{{{previous_election|}}}|
|-
! Previous
! Previous
| {{#if:{{{previous_election|}}}|[[{{{previous_election}}}|{{{previous_year|}}}]]|{{{previous_year|}}}}}
{{!}} style="text-align:center;" | {{{previous_link}}}}}
}}
{{#if:{{{next_link|}}}|{{!}}-{{!}}
{{#if:{{{next_year|}}{{{next_election|}}}|
! Next
{{!}} style="text-align:center;" | {{{next_link}}}}}
 
{{#if:{{{nominee1|}}}{{{nominee2|}}}|
|-
|-
! Next
! colspan="2" style="text-align:center; background:#eee;" | Candidates
| {{#if:{{{next_election|}}}|[[{{{next_election}}}|{{{next_year|}}}]]|{{{next_year|}}}}}
}}
}}


<!-- ===== CANDIDATES (up to 4) ===== -->
<!-- Candidate 1 -->
{{#if:{{{nominee1|}}}|
{{#if:{{{nominee1|}}}|
|-
|-
! colspan="2" style="text-align:center; background:#eee;" | Presidential election
| colspan="2" style="text-align:center;" | {{{image1|}}}
}}
{{#if:{{{image1|}}}|
|-
| colspan="2" style="text-align:center;" | {{{image1}}}
}}
{{#if:{{{nominee1|}}}|
|-
|-
! Nominee
! Nominee
| {{{nominee1}}}
| {{{nominee1}}}
}}
|-
{{#if:{{{running_mate1|}}}|
! Party
| {{{party1|}}}
|-
! Alliance
| {{{alliance1|}}}
|-
|-
! Running mate
! Running mate
| {{{running_mate1}}}
| {{{running_mate1|}}}
}}
{{#if:{{{party1|}}}|
|-
|-
! Party
! Popular vote
| {{{party1}}}
| {{{popular_vote1|}}}
}}
{{#if:{{{popular_vote1|}}}{{{percentage1|}}}|
|-
|-
! Votes
! Percentage
| {{#if:{{{popular_vote1|}}}|{{{popular_vote1}}}}} {{#if:{{{percentage1|}}}| ({{{percentage1}}})}}
| {{{percentage1|}}}
}}
}}


{{#if:{{{image2|}}}|
<!-- Candidate 2 -->
{{#if:{{{nominee2|}}}|
|-
|-
| colspan="2" style="text-align:center;" | {{{image2}}}
| colspan="2" style="text-align:center;" | {{{image2|}}}
}}
{{#if:{{{nominee2|}}}|
|-
|-
! Nominee
! Nominee
| {{{nominee2}}}
| {{{nominee2}}}
}}
|-
{{#if:{{{running_mate2|}}}|
! Party
| {{{party2|}}}
|-
! Alliance
| {{{alliance2|}}}
|-
|-
! Running mate
! Running mate
| {{{running_mate2}}}
| {{{running_mate2|}}}
}}
{{#if:{{{party2|}}}|
|-
|-
! Party
! Popular vote
| {{{party2}}}
| {{{popular_vote2|}}}
}}
{{#if:{{{popular_vote2|}}}{{{percentage2|}}}|
|-
|-
! Votes
! Percentage
| {{#if:{{{popular_vote2|}}}|{{{popular_vote2}}}}} {{#if:{{{percentage2|}}}| ({{{percentage2}}})}}
| {{{percentage2|}}}
}}
}}


{{#if:{{{image3|}}}|
<!-- Candidate 3 -->
{{#if:{{{nominee3|}}}|
|-
|-
| colspan="2" style="text-align:center;" | {{{image3}}}
| colspan="2" style="text-align:center;" | {{{image3|}}}
}}
{{#if:{{{nominee3|}}}|
|-
|-
! Nominee
! Nominee
| {{{nominee3}}}
| {{{nominee3}}}
}}
{{#if:{{{running_mate3|}}}|
|-
! Running mate
| {{{running_mate3}}}
}}
{{#if:{{{party3|}}}|
|-
|-
! Party
! Party
| {{{party3}}}
| {{{party3|}}}
}}
{{#if:{{{popular_vote3|}}}{{{percentage3|}}}|
|-
|-
! Votes
! Alliance
| {{#if:{{{popular_vote3|}}}|{{{popular_vote3}}}}} {{#if:{{{percentage3|}}}| ({{{percentage3}}})}}
| {{{alliance3|}}}
}}
 
{{#if:{{{image4|}}}|
|-
| colspan="2" style="text-align:center;" | {{{image4}}}
}}
{{#if:{{{nominee4|}}}|
|-
! Nominee
| {{{nominee4}}}
}}
{{#if:{{{running_mate4|}}}|
|-
|-
! Running mate
! Running mate
| {{{running_mate4}}}
| {{{running_mate3|}}}
}}
{{#if:{{{party4|}}}|
|-
! Party
| {{{party4}}}
}}
{{#if:{{{popular_vote4|}}}{{{percentage4|}}}|
|-
|-
! Votes
! Popular vote
| {{#if:{{{popular_vote4|}}}|{{{popular_vote4}}}}} {{#if:{{{percentage4|}}}| ({{{percentage4}}})}}
| {{{popular_vote3|}}}
}}
 
<!-- ===== MAP (optional) ===== -->
{{#if:{{{map_image|}}}|
|-
|-
| colspan="2" style="text-align:center;" | [[File:{{{map_image}}}|{{{map_size|300px}}}|alt={{{map_alt|}}}]]
! Percentage
}}
| {{{percentage3|}}}
{{#if:{{{map_caption|}}}|
|-
| colspan="2" style="text-align:center; font-size:90%;" | {{{map_caption}}}
}}
}}


<!-- ===== OFFICEHOLDERS ===== -->
{{#if:{{{title|}}}|{{!}}-{{!}}
{{#if:{{{title|}}}{{{before_election|}}}{{{after_election|}}}|
! Title
|-
{{!}} style="text-align:center;" | {{{title}}}}}
! colspan="2" style="text-align:center; background:#eee;" | {{{title}}}
{{#if:{{{before_election|}}}|{{!}}-{{!}}
}}
{{#if:{{{before_election|}}}|
|-
! Before election
! Before election
| {{{before_election}}}{{#if:{{{before_party|}}}|<br /><span style="font-size:90%;">{{{before_party}}}</span>|}}
{{!}} style="text-align:center;" | {{{before_election}}}}}
}}
{{#if:{{{before_party|}}}|{{!}}-{{!}}
{{#if:{{{after_election|}}}{{{ongoing|}}}|
! Before party
|-
{{!}} style="text-align:center;" | {{{before_party}}}}}
! {{#if:{{{ongoing|}}}|Elected {{#if:{{{posttitle|}}}|{{{posttitle}}}|{{{title|}}}}}|After election}}
{{#if:{{{after_election|}}}|{{!}}-{{!}}
| {{#if:{{{after_election|}}}|{{{after_election}}}|TBD}}{{#if:{{{after_party|}}}|<br /><span style="font-size:90%;">{{{after_party}}}</span>|}}
! After election
}}
{{!}} style="text-align:center;" | {{{after_election}}}}}
 
{{#if:{{{after_party|}}}|{{!}}-{{!}}
|}</includeonly><noinclude>
! After party
Simple, dependency-light election infobox for Chalo Chatu.
{{!}} style="text-align:center;" | {{{after_party}}}}}
 
|}
Parameters (common):
</includeonly><noinclude>
election_name, country, type, election_date, turnout, registered,
{{Documentation}}
previous_election, previous_year, next_election, next_year,
title, before_election, before_party, after_election, after_party, posttitle, ongoing=yes
 
Candidates (repeat 1–4):
imageN, nomineeN, running_mateN, partyN, popular_voteN, percentageN
 
Map (optional):
map_image  = filename only (no File:)
map_size    = 300px default
map_caption = text
map_alt    = alt text
 
Example:
{{Infobox election
| election_name = 2021 Zambian general election
| country = Zambia
| type = presidential
| election_date = {{Start date|2021|8|12|df=yes}}
| turnout = 70.61%
| image1 = HH2022.png|130x130px
| nominee1 = [[Hakainde Hichilema]]
| running_mate1 = [[Mutale Nalumango]]
| party1 = United Party for National Development
| popular_vote1 = 2,852,348
| percentage1 = 59.02%
| image2 = Edgar Lungu, 26 july 2018 (cropped).jpg|130x130px
| nominee2 = [[Edgar Lungu]]
| running_mate2 = [[Nkandu Luo]]
| party2 = Patriotic Front (Zambia)
| popular_vote2 = 1,870,780
| percentage2 = 38.71%
| map_image = Maps-blogs21-lightonphiri org-2021 zambia presidential elections-by constituencies-overall.svg
| map_caption = 2021 Presidential results by constituency
| title = President
| before_election = [[Edgar Lungu]]
| before_party = Patriotic Front (Zambia)
| after_election = [[Hakainde Hichilema]]
| after_party = United Party for National Development
}}
 
Styling relies on your site’s .infobox CSS.
</noinclude>
</noinclude>

Latest revision as of 11:02, 19 September 2025

<templatestyles src="Module:Documentation/styles.css"></templatestyles>