Plantilla:Infobox election

| Aquest plantilla utilitza TemplateStyles: |
| This template gets personalization information from Module:Itemgroup/list and Module:Itemgroup/groups |
Infobox to show the aggregated final results of the elections. It also shows results of binary (Yes/No) or multiple choice referendums.
Syntax
{{infotaula eleccions}}
It does not require any parameters to work. 100% of the content is fetched from Wikidata (WD).
Instructions of what properties to use and how to fill them to get the desired result can be found in the following sections.
However, in #Configuration settings you will find some settings for making configuration changes.
Operation
~
The infobox election runs exclusively from WD information.
It can handle the following types of elections:
- Q1196727: elections by direct voting to a candidate; the one with the most votes wins.
- Q877353: the vote of the voters is equal to the Q1196727, but not to select just one final elected, but a set of representatives who will choose the president / maximum representative.
- Q615255: It is a direct vote in which, if no candidate obtains an absolute majority, a second ballot is held in which only the two most voted candidates participate, and the winner of this second ballot are the final elected.
- Q31764: Typical voting by parliamentary chambers where a political party or coalition is voted on a list. In this case, the application of a formula on the number of votes determines the number of seats or positions obtained by the party list. This list can be open or closed. This aspect is indifferent to the infobox, as it only shows the final results, but not the elected deputies.
- Q2746726 or multi-vote : These are elections where each voter can vote for more than one candidate. In this modality there are as many votes as positions to be filled, and in the case of Q3786779 (Q3786779), fewer are available. In the multi-vote method, the infobox only works with the information from P991, ie after the election date, to avoid long lists of P726 (P726) that will not be elected. Although voting is by candidate and not by party lists, the infotable can present information of the elects aggregated by party (when the P991 contains P1410 (P1410)), showing the seats won. Another modality is to present the list of elected people, showing the votes obtained; in this case, the ratios shown represent the support received by voters, not the distribution rate, because the sum may be greater than 100%, as it is a multi-vote model. This double modality allows to manage the item with the global results and the items with the detailed results by constituency.
- Double Elections: These are in fact two elections held on the same election day. They are usually two-chamber elections in bicameral systems, but there are also municipal elections that elect mayor and councilors separately, with two direct votes. The infobox only handle TWO elections with one office each.
- Q43109: are votes where, unlike elections, the vote is not a support for a political option , but for or against a question-shaped text. In very exceptional cases, referendums don't have a binary answer, but a "choice" between several possible answers. To address these cases, the information structure is analogous to that described for an election, with small differences.
In the following summary we see the properties used and the structures of WD corresponding to the examples of the documentation for each type of election:
| Instructions and
WD data model >>
|
/ | [[template:Infobox election/proportional/doc|]] | [[template:Infobox election/two rounds/doc|]] | [[template:Infobox election/bloc_voting/doc|]] | Double Elections | Referendums | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Election type >> | direct | indirect | proportional | election item | round 1 | round 2 | item eleccions | election item | election 1 | election 2 | |
P31 (P31) > > > > > > > qualifiers: |
Election + type + jurisdiction, etc. NO year nor edition | Q24097670 (Q24097670) | Election + type + jurisdiction, etc. NO year nor edition | Q76853179 (Q76853179) + Election + type + jurisdiction, etc. NO year nor edition | Election + type + jurisdiction, etc. NO year nor edition | Mandatori.
Must be = Q43109 (Q43109) or one of its subclasses. | |||||
| P155 (P155), as qualifier of P31 |
← 1st.round |
||||||||||
| P156 (P156), as qualifier of P31 |
2nd.round → |
||||||||||
| P18 (P18) | , (Only when qualif. P180 (P180) = Q905151 (Q905151)) |
, (Only when qualif. P180 (P180) = Q905151 (Q905151)) |
, (Only when qualif. P180 (P180) = Q905151 (Q905151)) | ||||||||
| P17 (P17) | |||||||||||
| P1001 (P1001) | |||||||||||
| P585 (P585) | . If it is multi-value and does not refer to the same call, it must be accompanied by P518 indicating the meaning of that date. | . 2 values + P518 linked to each round | . same rules as "direct election" | ||||||||
| P580 (P580) + P582 (P582) | Instead to P585 when ballot was not on specifics days, but in a period; same constraints | ||||||||||
| P2047 (P2047) + P518 = Q11642595 (Q11642595) | |||||||||||
| P541 (P541) |
, may be together to a vice-president position, when both are a team option. |
+ common qualifiers + P1342 (P1342), P1083 (P1083) from the chamber, when not all seats are on votation. | same rules as "direct election" | same rules as "proportional election" | same qualifiers | ||||||
| P8196 (P8196) | |||||||||||
| P726 (P726) |
common qualifiers: P18 (P18), Partit (P102) o P1268 (P1268), P210 (P210), P6149 (P6149), P1111 (P1111) (mandatory), P1545 (P1545) qualifs. related to political party: P1813 (P1813), P8972 (P8972) or P154 (P154), P465 (P465), P5832 (P5832), P460 (P460) |
only "elected candidates" in round 1 | . Only the seats won by the elected candidates are listed in the aggregate item of the election | Same conditions as the correspondance type of election for this case | Only when multi-response. +P1111 (P1111) + P465 (P465) | ||||||
| P991 (P991) |
qualifs. P1410 (P1410) in case of proportional elections |
, |
qualifs. P1410 (P1410), in case of aggregated item |
same qualifiers | |||||||
| P1867 (P1867) | |||||||||||
| P1868 (P1868) | |||||||||||
| P1697 (P1697) | |||||||||||
| P5044 (P5044) | |||||||||||
| P5045 (P5045) | |||||||||||
| P527 (P527) | May point to items of partial results by constituency, which are not covered by this infobox. | Point to the round items with P1545 (P1545) qualifier | May point to items of partial results by constituency, which are not covered by this infobox. | Point to the round items with P1545 (P1545) qualifier | May point to items of partial results by constituency, which are not covered by this infobox. | ||||||
| P361 (P361) | it may indicate that it is part of some grouping, such as "elections to the European Parliament of the year xxxx". | Point to the related election items with P1545 (P1545) qualifier | it may indicate that it is part of some grouping, such as "elections to the European Parliament of the year xxxx". | it may indicate a kind of grouping, but avoid to confuse with P31 | Point to the related election items with P1545 (P1545) qualifier | it may indicate that it is part of some grouping, such as "Referendums from independence preparation period". | |||||
| P1846 (P1846) | , (Only when qualif. P180 (P180) = Q19571328 (Q19571328)) |
, (Only when qualif. P180 (P180) = Q19571328 (Q19571328)) |
, (Only when qualif. P180 (P180) = Q19571328 (Q19571328)) | ||||||||
| Lloc web (P856) | |||||||||||
| P2572 (P2572) | |||||||||||
| P1536 (P1536) | . It allows building a box at the foot with the succession of individual positions (presidents, mayors, etc.); ex.:Q24639891 (Q24639891). Or, the investiture of an elected president among the deputies of the election we are dealing with; ex:Q48838589 (Q48838589) |
Same description as another type of election. | |||||||||
| P1476 (P1476) | |||||||||||
| P8683 (P8683) | :P8683 + :P465 (P465), P642 (P642) | ||||||||||
| P8682 (P8682) | :P8682 + :P465 (P465), P642 (P642) | ||||||||||
| Data get from higher level | |||||||||||
| P2097 (P2097) from P541 (P541) | |||||||||||
| P279 (P279) from P541 (P541) | generic name of seat positions | ||||||||||
| P41 (P41) from P1001 (P1001) | |||||||||||
| P31 (P31) from P726 (P726) | to determine if the election is person-oriented or party-oriented | ||||||||||
| P18 (P18) from P726 (P726) o de P210 (P210) | candidate personal image in personal oriented elections; or lead candidate in case of proportional list elections | ||||||||||
| Partit (P102) from P726 (P726) | |||||||||||
| P1813 (P1813) from P726 (P726) | political party acronym, in case of proportional elections | ||||||||||
| P154 (P154) from P726 (P726) | political party logo, in case of proportional elections | ||||||||||
| P465 (P465) from P726 (P726) | used to draw result bars with this colour. | ||||||||||
Configuration settings
Any information displayed by this infobox is fetched from WD, as it is described in exemples and documentations sections.
In addition, the infobox has some manual parameters to make changes to his appearance or operation.
- type_election: The infobox infers the election type or obtains it from P8196 (P8196). If you want to select it manually, the accepted values are: direct, proportional, two_rounds, double.
- election_name / name: Text to show as a title, above of the infobox. It may be useful to put more synthetic text. By default, the article name is used.
- id_position1: In "double elections", the letter "A" is used by default to indicate the results of the first election. This parameter allows you to indicate which character you want to use instead.
- id_position2: Similar to above, to swap the letter "B" for another digit.
- roundcolor_1: In double and two-round elections, it allows you to change the color that identifies the first election or first round.
- roundcolor_2: In double and two-round elections, it allows you to change the color that identifies the second election or second round.
- yes_color: Bar color for the "Yes" option in a referendum. By default is #2ca02c .
- not_color: Bar color for the "No" option in a referendum. By default is #d62728 .
- threshold_list
- All candidates are shown before the election date. After elections only are shown: those who have won a seat or who have obtained more than 2% of the votes in the case of proportional elections, or more than 25% for non-proportional elections. This parameter allows you to alter this threshold. Only the figure must be informed (as 3.5 or 1.0, etc.).
- blacklist_diagram:
- The P14226 (P14226) property contains one or more diagrammatic images of election results. If we do not want to show any of the images, we must add P180 (P180) - if it does not exist - with a descriptive value that we will use to indicate it in this parameter, in the format Qnnnn, Qnnnn,...., in case we have several images to exclude.
- item: Item Qid to use, when is different from the present article
- debug: The infobox election has a debug system that displays the value of the parameter collection that any of the subtemplates has received. Possible values for this parameter are:
- core: data passed to /core
- prepdemo: data passed to /prepare for demography
- preprefe: data passed to /prepare for referendum
- prepcand: data passed to /prepare for each candidate
- prepmult: data passed to /prepare_multi
- showblok: data passed to /showblocks. Must be accopanied with a Qnnnnnn of candidate
- showrefe: data passed to /showblocks for referendum
Tech documentation
See: template:Infobox election/doctech/doc for schema and functionalities of involved sub-templates.
Examples
| / Q1658720 (Q1658720) | |
|---|---|
| ← → | |
| Q51591359 | |
Q17082048 (Q17082048) | |
|---|---|
| ← → | |
| Q51591359 | |
Q7020999 (Q7020999) | |
|---|---|
| ← → | |
| Q51591359 | |
| Q101110072 (Q101110072) | |
|---|---|
| ← → | |
| Q51591359 | |
Els editors poden fer proves amb aquesta plantilla al seu espai de proves ([{{fullurl:Special:Mypage/MediaWiki:Templatesandbox-suffix/⧼Lang⧽/Plantilla:Infobox election | action=edit&preload=Plantilla%3AInfobox+election}}&summary=Versi%C3%B3+per+a+proves+de+%5B%5BPlantilla%3AInfobox+election%5D%5D&editintro=Plantilla%3A%C3%9As+de+la+plantilla%2Fav%C3%ADs+d%27edici%C3%B3 crea] | [{{fullurl:Special:Mypage/MediaWiki:Templatesandbox-suffix/⧼Lang⧽/Plantilla:Infobox election | action=edit }} modifica])
Afegiu categories en la subpàgina /ús. Vegeu les subpàgines d'aquesta plantilla, utilització de paràmetres.