Template:Political party data
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value).
| This template is rated as beta. It is considered ready for widespread use, but as it is still relatively new, it should be applied with some caution to ensure results are as expected. |
| Editing of this template by new or unregistered users is currently disabled. See the protection policy and protection log for more details. If you cannot edit this template and you wish to make a change, you can submit an edit request, discuss changes on the talk page, request unprotection, log in, or create an account. |
Usage
{{Political party data|<data_type>|<party>|<institution>|extra parameters}}
Parameters
<section begin="Parameters"/>
| Parameter | Description |
|---|---|
| 1 | The type of data requested and pulled from Wikidata, from the following list:
This parameter is mandatory. |
| 2 | The name of the party, either as the Wikidata qID of the party or omitted when the module is called from the Wikipedia page of the entity (alternatively, thisparty can be used to refer to the party in question).
This parameter is optional when called from the page of the party. Notes:
|
| 3 | The name of the institution, from the following list:
Notes:
This parameter is mandatory when |
| extra parameters | The following extra parameters can also be used, depending on the requested data_type:
These parameters are optional. |
Test cases
The template's module has two testcase pages:
- Module:European and national party data/testcases composition bar for the
seat composition barandseat composition bar compactdata types; and - Module:European and national party data/testcases for all other data types.
Updating the template
The template's module draws its data from two sources:
- Wikidata for all data points returned by the template's module; and
- commons:Data:Mapping of national parties members of European parties to lower and upper houses.tab which maps the national member parties of European political parties and also serves to link member states (and, therefore, national parties) to their lower and upper houses.
To update data returned by the module, go to the Wikidata page of the entity in question (the link is often provided as a comment in the infobox of the Wikipedia article), and edit the relevant property, preferably by adding a new value and marking it as preferred (instead of deleting outdated information).
Here are some relevant properties for the module:
- number of seats in assembly: P1410, with the following qualifiers:
- short name/acronym: P1813
- colour/sRGB color hex triplet: P465
- country: P17
- foundation date: P571
- individual members: P2124
- official name: P1448
- parliamentary group: P4100
- chairperson: P488
- public funding: P12919
- official website: P856
Wherever possible, try and add:
- a
start time(P580) qualifier (and a matchingend time(P582) in the outdated entry) or apoint in time(P585) qualifier, and - a reference, including the
reference URL(P854),title(P1476),retrieved(P813), andpublisherqualifiers (P123).
Updating Wikidata ensures that updated and sourced information is available not just to this Wiki, but to all versions of Wikipedia, as well as to other services drawing information from Wikidata.
Translating the module
To adapt the module to a new Wiki, follow these steps:
- Create two modules to replicate the modules below (the content must remain the same as in the English version):
- Create the following files and translate them as needed (translate only the non-English parts, as indicated):
- Translate the module documentations, and adapt the examples as necessary using the translated terms;
- Create testcases, such as the ones below, and adapt the examples as necessary using the translated terms:
- Create three templates to replicate the ones below:
- Translate the template documentations, based on the module documentations, and adapt the examples as necessary using the translated terms;
- Add the two modules in the "Wikipedia" sections of the two relevant Wikidata pages below:
- Create a topic on the consolidated module talk page to adapt the content of the common module (in particular its function for composition bars) to the new Wiki. After being adapted, the main module will be synchronised to update the modules in all Wiki languages; this helps ensure that the same module is used across Wikis, which is essential to keep its functions updated.
Examples
Data type seats
| Code | Result | Output |
|---|---|---|
{{Political party data|seats|Q49768|EP}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | number of seats of the Social Democratic Party of Germany (called by its Wikidata qID) in the European Parliament |
{{Political party data|seats|Q13564543|ms-lower-house|reference=yes}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | number of seats of Austria's NEOS (called by its Wikidata qID) in the National Council, with reference |
{{Political party data|seats|Q138198|ms-upper-house}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | number of seats of the Spanish Socialist Workers' Party (called by its Wikidata qID) in the Senate |
Data type seat share
| Code | Result | Output |
|---|---|---|
{{Political party data|seat share|Q49768|EP|reference=yes}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | share of seats of the Social Democratic Party of Germany (called by its Wikidata qID) in the European Parliament, with reference |
{{Political party data|seat share|Q13564543|ms-lower-house}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | share of seats of Austria's NEOS (called by its Wikidata qID) in the National Council |
{{Political party data|seat share|Q655611|ms-lower-house|constituency=61}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | share of seats of Belgium's Écolo (called by its Wikidata qID) in the French-speaking seats of the Chamber of Representatives |
Data type seat composition bar
| Code | Result | Output |
|---|---|---|
{{Political party data|seat composition bar|Q49768|ms-lower-house}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | composition bar of seats of the Social Democratic Party of Germany (called by its Wikidata qID) in the German Bundestag |
{{Political party data|seat composition bar|Q49768|EP|reference=yes}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | composition bar of seats of the Social Democratic Party of Germany (called by its Wikidata qID) in the European Parliament, with reference |
{{Political party data|seat composition bar|Q655611|ms-lower-house|constituency=61}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | composition bar of seats of Belgium's Écolo (called by its Wikidata qID) in the French-speaking seats of the Chamber of Representatives |
{{Political party data|seat composition bar|Q49768|EP|width=80%|background-color=blue|border=green|bar-color=red}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | composition bar of seats of the Social Democratic Party of Germany (called by its Wikidata qID) in the European Parliament, with special parameters |
{{Political party data|seat composition bar|Q49768|EP|width=80%|background-color=#FFFF00|border=#008080|bar-color=#A020F0}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | composition bar of seats of the Social Democratic Party of Germany (called by its Wikidata qID) in the European Parliament, with special parameters |
{{Political party data|seat composition bar compact|Q49768|EP|width=80%|border=#008080|bar-color=#A020F0}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | compact version of the composition bar of seats of the Social Democratic Party of Germany (called by its Wikidata qID) in the European Parliament, with special parameters |
Other data types
| Code | Result | Output |
|---|---|---|
{{Political party data|acronym|Q49768}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | acronym of the Social Democratic Party of Germany |
{{Political party data|color|Q49768}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | colour of the Social Democratic Party of Germany |
{{Political party data|country|Q1315362}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | country of Levice (called by its Wikidata qID) |
{{Political party data|foundation date|Q49768}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | foundation date of the Social Democratic Party of Germany |
{{Political party data|individual members|Q49768|reference=yes}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | individual members of the Social Democratic Party of Germany, with reference |
{{Political party data|label|Q49768}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | label of the Social Democratic Party of Germany |
{{Political party data|official name|Q49768}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | official name of the Social Democratic Party of Germany |
{{Political party data|parliamentary group|Q170972}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | parliamentary group of France's Socialist Party |
{{Political party data|public funding|Q49768}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | public funding of the Social Democratic Party of Germany |
{{Political party data|website|Q667680}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | website of the Netherlands' GroenLinks |
{{Political party data|official name|Q22748|verbose=yes}}
|
Lua error in Module:European_and_national_party_data/config at line 229: attempt to index field 'data' (a nil value). | official name of Germany's Die PARTEI, showing verbose error message |