Difference between revisions of "Template:Infobox legislative election/sandbox"
imported>Number 57 (This?) |
imported>Number 57 (If party2) |
||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 22: | Line 22: | ||
| labelstyle = width:5em;white-space:nowrap; | | labelstyle = width:5em;white-space:nowrap; | ||
| − | | data2 = { | + | | label2 = Turnout |
| + | | data2 = {{{turnout|}}} | ||
| − | | label3 = | + | | label3 = Reporting |
| − | | data3 = {{{ | + | | data3 = {{#if:{{{reporting|}}}|{{center|{{Percentage bar|{{{reporting}}}|{{{reporting}}}%|1BCE0E}}}}{{small|as of '''{{{last_update}}} {{{time_zone}}}''' }}}} |
| − | + | | data4 = <nowiki /> | |
| − | | data4 | ||
| − | |||
| − | |||
| − | |||
{{(!}} class="wikitable" style="width: 100%; margin:0;" | {{(!}} class="wikitable" style="width: 100%; margin:0;" | ||
{{!-}} class="nowrap" | {{!-}} class="nowrap" | ||
! Party | ! Party | ||
! Leader | ! Leader | ||
| − | {{# | + | {{#switch:{{{ongoing|}}}|counting|yes= |
| − | {{#ifeq:{{{first_election|}}}|yes||! | + | {{#ifeq:{{{first_election|}}}|yes||! {{#ifeq:{{{ongoing|}}}|counting|Seats before|Current seats}}}} |
| − | + | |#default= | |
| − | {{#ifeq:{{{ongoing|}}}|counting| | ||
| − | |||
| − | | | ||
! <abbr title="Percentage vote share">%</abbr> | ! <abbr title="Percentage vote share">%</abbr> | ||
! Seats | ! Seats | ||
| Line 59: | Line 53: | ||
| first_election = {{{first_election|}}} | | first_election = {{{first_election|}}} | ||
}} | }} | ||
| − | | ! {{Infobox legislative election/row | + | | {{#if:{{{party2|}}}|! {{Infobox legislative election/row |
| heading = {{{heading2|}}} | | heading = {{{heading2|}}} | ||
| party = {{{party2|}}} | | party = {{{party2|}}} | ||
| Line 69: | Line 63: | ||
| ongoing = {{{ongoing|}}} | | ongoing = {{{ongoing|}}} | ||
| first_election = {{{first_election|}}} | | first_election = {{{first_election|}}} | ||
| − | }} | + | }}}} |
| {{#if:{{{party3|}}}|! {{Infobox legislative election/row | | {{#if:{{{party3|}}}|! {{Infobox legislative election/row | ||
| heading = {{{heading3|}}} | | heading = {{{heading3|}}} | ||
| Line 380: | Line 374: | ||
}} | }} | ||
{{!)}} | {{!)}} | ||
| − | <div class="nowrap" style="width:100%;font-style: italic; padding:0.3em;">{{# | + | <div class="nowrap" style="width:100%;font-style: italic; padding:0.3em;">{{#switch:{{{ongoing|}}}|counting|yes=|#default=This lists parties that won seats. See the complete results [[#{{{results_sec|Results}}}|below]].}}</div><!-- |
-->{{infobox|child=yes | -->{{infobox|child=yes | ||
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{map|}}}|upright={{#if:{{{map_upright|}}}|{{{map_upright}}}|1.3}}|alt={{{map_alt|}}}}} | | image = {{#invoke:InfoboxImage|InfoboxImage|image={{{map|}}}|upright={{#if:{{{map_upright|}}}|{{{map_upright}}}|1.3}}|alt={{{map_alt|}}}}} | ||
| Line 389: | Line 383: | ||
{{#if:{{{before_election|}}}{{{after_election|}}}|<table style="width: 100%; border-spacing: 0;"> | {{#if:{{{before_election|}}}{{{after_election|}}}|<table style="width: 100%; border-spacing: 0;"> | ||
<tr> | <tr> | ||
| − | <th {{#if:{{{before_image|}}}|colspan="2"}} scope="col" style="width:50%;">{{#if:{{{before_election|}}}|{{# | + | <th {{#if:{{{before_image|}}}|colspan="2"}} scope="col" style="width:50%;">{{#if:{{{before_election|}}}|{{#switch:{{{ongoing|}}}|counting|yes=Incumbent {{{title}}}|#default={{{title}}} before}}}}</th> |
| − | <th {{#if:{{{after_image|}}}|colspan="2"}} scope="col" style="width:50%; text-align:right;">{{# | + | <th {{#if:{{{after_image|}}}|colspan="2"}} scope="col" style="width:50%; text-align:right;">{{#switch:{{{ongoing|}}}|counting|yes=|#default={{#if:{{{after_election|}}}|{{If empty|{{{posttitle|}}}|{{Delink|1={{{title}}}}} after}}}}}}</th> |
</tr> | </tr> | ||
<tr>{{#if:{{{before_image|}}}| | <tr>{{#if:{{{before_image|}}}| | ||
<td style="padding-right: 3px;">{{#invoke:InfoboxImage|InfoboxImage|image={{{before_image|}}}|size={{{before_image_size|}}}|sizedefault=x65px}}</td>}} | <td style="padding-right: 3px;">{{#invoke:InfoboxImage|InfoboxImage|image={{{before_image|}}}|size={{{before_image_size|}}}|sizedefault=x65px}}</td>}} | ||
<td style="width: 50%;">{{{before_election|}}}{{#if:{{{before_party|}}}|<br />{{Infobox election/shortname|name={{{before_party}}}}}}}</td> | <td style="width: 50%;">{{{before_election|}}}{{#if:{{{before_party|}}}|<br />{{Infobox election/shortname|name={{{before_party}}}}}}}</td> | ||
| − | <td style="text-align:right; width: 50%;">{{# | + | <td style="text-align:right; width: 50%;">{{#switch:{{{ongoing|}}}|counting|yes=|#default={{#if:{{{after_election|}}}|{{{after_election}}}{{#if:{{{after_party|}}}|<br />{{Infobox election/shortname|name={{{after_party}}}}}}}}}}}</td>{{#if:{{{after_image|}}}| |
<td style="padding-left: 3px;">{{#invoke:InfoboxImage|InfoboxImage|image={{{after_image|}}}|size={{{after_image_size|}}}|sizedefault=x65px}}</td>}} | <td style="padding-left: 3px;">{{#invoke:InfoboxImage|InfoboxImage|image={{{after_image|}}}|size={{{after_image_size|}}}|sizedefault=x65px}}</td>}} | ||
</tr> | </tr> | ||
</table>}} }} | </table>}} }} | ||
| + | | data5 = {{{module|}}} | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
| − | {{ | + | {{documentation}} |
</noinclude> | </noinclude> | ||
Latest revision as of 15:17, 3 January 2021
| This is the template sandbox page for Template:Infobox legislative election (diff). See also the companion subpage for test cases. |
This infobox is used for a parliamentary election with multiple parties winning seats.
Usage
{{Template:PAGENAMETDOC | election_name = {{{election_name}}} | country = {{{country}}} | flag_year = {{{flag_year}}} | previous_election = {{{previous_election}}} | next_election = {{{next_election}}} | election_date = {{{election_date}}} | seats_for_election = {{{seats_for_election}}} | majority_seats = {{{majority_seats}}} | turnout = {{{turnout}}} | ongoing =
| party1 = {{{party1}}} | colour1 = | leader1 = {{{leader1}}} | percentage1 = {{{percentage1}}} | seats1 = 20 | last_election1 = 0
| party2 = {{{party2}}} | colour2 = | leader2 = {{{leader2}}} | percentage2 = {{{percentage2}}} | seats2 = 10 | last_election2 = 5
| map = {{{map}}} | map_upright = | map_alt = {{{map_alt}}} | map_caption = {{{map_caption}}}
| title = {{{title}}} | posttitle = {{{posttitle}}} | before_election = {{{before_election}}} | before_party = {{{before_party}}} | after_election = {{{after_election}}} | after_party = {{{after_party}}} }}
{{Infobox legislative election
| election_name =
| country =
| flag_year = <!-- if a variant is needed -->
| previous_election =
| next_election =
| election_date =
| seats_for_election = <!-- description-- >
| majority_seats = <!-- number -->
| turnout =
| reporting =
| last_update =
| time_zone =
| ongoing = <!-- or future -->
| first_election = <!-- yes/no (blank is no) -->
| heading1 =
| party1 =
| leader1 =
| colour1 =
| percentage1 = <!-- incl. percentage sign -->
| seats1 =
| last_election1 = <!-- Write 'new' if new party -->
| heading2 =
| party2 =
| leader2 =
| colour2 =
| percentage2 = <!-- incl. percentage sign -->
| seats2 =
| last_election2 = <!-- Write 'new' if new party -->
| heading3 = <!-- up to | heading35 = -->
| party3 = <!-- up to | party35 = -->
| leader3 = <!-- up to | leader35 = -->
| colour3 = <!-- up to | colour35 = -->
| percentage3 = <!-- up to | percentage35 = -->
| seats3 = <!-- up to | seats35 = -->
| last_election3 = <!-- up to | last_election35 = -->
| results_sec =
| map =
| map_upright =
| map_alt =
| map_caption =
| title = <!-- Prime Minister or similar -->
| posttitle =
| before_election =
| before_image =
| before_image_size = <!-- default size is x65px -->
| before_party =
| after_election =
| after_image =
| after_image_size = <!-- default size is x65px -->
| after_party =
}}
Parameters
election_name- Name of the elections.
country- Name of the country or territory the elections are taking place in
previous_election- Link to the previous elections (e.g. [[United Kingdom general election, 2010|2010]])
next_election- Link to the following elections (e.g. [[United Kingdom general election, 2015|2015]])
election_date- Date of the elections
seats_for_election- Description of which seats this election is about, incl. chamber and how many
majority_seats- The number of seats needed for a majority
first_election- Change to "yes" if this the first election of its kind
ongoing- Change to "yes" if the election results haven't been released
results_sec- Name of section in the article where the results of the election are listed.
turnout- % voter turnout
party1..35- Name of the party (e.g. United Party)
leader1..35- Leader of the party
colour1..35- Custom party colour
percentage1..35- The party's popular vote share
seats1..35- Number of seats won by the party
last_election1..35- Number of seats won at the previous elections (template coding uses it to work out seat change)
heading1..35- Adds a heading above a particular results row
map- Image file of a map
map_upright- Map size scaling factor; default is
1.3 map_alt- WP:ALT
map_caption- Caption text, perhaps including a {{Legend}}
title- Title of the head of government (e.g. [[Prime Minister of the United Kingdom|Prime Minister]])
posttitle- Title after the election
before_election- Head of government before the elections
before_party- Party of the head of government prior to the elections
before_image- Image of the outgoing head of government, default size is x65px
after_election- Head of government after the elections
after_party- Party of the head of government after the elections
after_image- Image of the elected head of government, default size is x65px
| The above documentation is transcluded from Template:Infobox legislative election/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |