قالب:Political party data

Error: {{قالب:Political party data}}: National party not valid: THISPARTY (help)

Template documentation[view] [edit] [history] [purge]

Usage

{{Political party data|<data_type>|<party>|<institution>|extra parameters}}

Parameters

Parameter Description
1 The type of data requested and pulled from Wikidata, from the following list:
  • seats: the number of seats of one or more entities in one or more institutions (P1410);
  • seat share: the share of seats of one or more entities in one or more institutions (based on P1410);
  • seat composition bar: a composition bar showing the seats of one or more entities in one or more institutions (based on P1410);
  • acronym: the short name of the entity (P1813);
  • color: the official colour of the entity as a hex code (P465);
  • country: the country in which the entity is registered (P17);
  • foundation date: the date on which the entity was founded (P571);
  • foundation year: the year in which the entity was founded (P571);
  • individual members: the number of individual members of the entity (P2124);
  • individual members date: the reference date for the number of individual members of the entity (based on P2124);
  • individual members year: the reference year for the number of individual members of the entity (based on P2124);
  • label: the name of the entity;
  • official name: the official long-form name of the entity (P1448);
  • parliamentary group: the parliamentary group the entity belongs to (P4100);
  • public funding: the amount of public funding received by the entity (P12919); or
  • website: the official website of the entity (P856), stripped from "https", "http" and "www" prefixes.

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:

  • given the cost of calling Wikidata when using a specific qID (i.e., not calling Wikidata from a linked Wikipedia page), the special parameter "thisparty" should be used whenever this module is called from the page of a political party.
3 The name of the institution, from the following list:

Notes:

  • For lower and upper houses, the template will automatically determine the relevant body, using this table; and
  • For the European Parliament, the module will automatically use the member state's number of seats in the Parliament.

This parameter is mandatory when data_type is seat, seat share, or seat composition bar.

extra parameters The following extra parameters can also be used, depending on the requested data_type:
  • all data_types:
    • reference will display the reference when |reference=yes (this parameter is ignored for the seats of lower or upper houses of European entities, as many national figures are summed);
  • seat share:
    • constituency will override the institution's number of seats (for instance when the party is part of a special constituency);
  • seat composition bar:
    • constituency will override the institution's number of seats (for instance when the party is part of a special constituency);
    • width will specify the width of the bar and can have the following formats: "80" (default unit is pixel), "80px", "80em", or "80%" (without spaces);
    • percent will display the percentage when |percent=yes;
    • bar-color, background-color, and border will override default colours when provided an hexadecimal value (e.g."#123ABC", including the pound sign) or a recognised colour (e.g. "red").
  • all other data_types:
    • verbose: will display an error message when no value exists on Wikidata, as well as a relevant link, when |verbose=yes (otherwise the field is empty).

These parameters are optional.

Test cases

The template's module has two testcase pages:

Updating the template

The template's module draws its data from two sources:

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:
    • legislative body: P194
    • executive body (for the European Commission and European Council): P208
    • parliamentary term (for the European Parliament and European Commission): P2937
  • short name/acronym: P1813
  • colour/sRGB color hex triplet: P465
  • country: P17
  • foundation date: P571
  • individual members: P2124
  • official name: P1448
  • parliamentary group: P4100
  • public funding: P12919
  • official website: P856

Wherever possible, try and add:

  • a start time (P580) qualifier (and a matching end time (P582) in the outdated entry) or a point in time (P585) qualifier, and
  • a reference, including the reference URL (P854), title (P1476), retrieved (P813), and publisher qualifiers (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:

  1. Create two modules to replicate the modules below (the content must remain the same as in the English version):
    1. Module:European and national party data, and
    2. Module:European and national party data/Wd;
  2. Create the following files and translate them as needed (translate only the non-English parts, as indicated):
    1. Module:European and national party data/config, and
    2. Module:European and national party data/Wd/i18n;
  3. Translate the module documentations, and adapt the examples as necessary using the translated terms;
  4. Create testcases, such as the ones below, and adapt the examples as necessary using the translated terms:
    1. Module:European and national party data/testcases, and
    2. Module:European and national party data/testcases composition bar;
  5. Create three templates to replicate the ones below:
    1. Template:EUPP data,
    2. Template:Political party data, and
    3. Template:EU institution seats;
  6. Translate the template documentations, based on the module documentations, and adapt the examples as necessary using the translated terms;
  7. Add the two modules in the "Wikipedia" sections of the two relevant Wikidata pages below:
    1. Module:European and national party data
    2. Module:European and national party data/Wd
  8. 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}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. 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}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. 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}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. 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}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. 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}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. 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}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. 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}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. 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}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. 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}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. 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}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. 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}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. 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}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. acronym of the Social Democratic Party of Germany
{{Political party data|color|Q49768}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. colour of the Social Democratic Party of Germany
{{Political party data|country|Q1315362}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. country of Levice (called by its Wikidata qID)
{{Political party data|foundation date|Q49768}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. foundation date of the Social Democratic Party of Germany
{{Political party data|individual members|Q49768|reference=yes}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. individual members of the Social Democratic Party of Germany, with reference
{{Political party data|label|Q49768}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. label of the Social Democratic Party of Germany
{{Political party data|official name|Q49768}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. official name of the Social Democratic Party of Germany
{{Political party data|parliamentary group|Q170972}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. parliamentary group of France's Socialist Party
{{Political party data|public funding|Q49768}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. public funding of the Social Democratic Party of Germany
{{Political party data|website|Q667680}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. website of the Netherlands' GroenLinks
{{Political party data|official name|Q22748|verbose=yes}} خطأ لوا في package.lua على السطر 80: module 'Module:European_and_national_party_data/Wd' not found. official name of Germany's Die PARTEI, showing verbose error message