Aller au contenu

Tipapitcikesinihikan:Databox/doc

E pe otciparik Wikipetcia

Main documentation is maintained at
Wikidata:Template:Databox/doc

This module provides an as simple as possible infobox system based on Wikidata. It is fully automated, does not require any configuration to be used and does not have any declination based on the type of entity (person, place...).

How does it work?

[meckotcita ka itactek]

This module is the backend code of the Databox template.

It uses the Wikidata item linked to the current page or the item which id is filled into the item parameter to automatically build an infobox.

Its basic algorithm is:

  • Use the label of the item or, if none exists, the title of the page for the infobox title.
  • Use the value of P18 for the main image.
  • Use the value(s) of P31 for the data table title.
  • Take all the properties used by the item, sort them according to MediaWiki:Wikibase-SortedProperties, and for each one:
    • If the property has the datatype external-id, commonsMedia or quantity, do not display anything.
    • If the property is in the site_excluded_properties array of the module, do not display anything (it is done in order to filter properties not very relevant for displaying in infoboxes).
    • If the property has more than 5 values do not display anything (to avoid long lists in the infobox).
    • Use default Wikibase rendering system to display the values that have the "best" rank (i.e. the values with the rank "preferred", if some exists, and, if not, the ones with the rank "normal").
  • If there is value for P625, then display a map using Kartographer.


Check the Module code is installed
1. Databox uses Lua-code. The code will be added to the Module:Databox page.

  • Add the sitelink of the newly-created Wikipedia page (Module:Databox) to the Wikidata item of Module:Databox (Q53931871)

Check the Template code is installed
2. To invoke the databox template, ensure the template code below has been added to Template:Databox page:

{{#invoke:Databox|databox|useImage={{{useImage|}}}|excludeProperties={{{excludeProperties|}}}}}
  • Connect the newly-created Template:Databox page to the Wikidata item of Template:Databox (Q20702632)

You're ready to add databoxes to your Wikipedia pages
3. Go to a page or article you wish to add databox too, enter the edit mode and add the template {{Databox}} at the top of the page.

4. Preview the page to verify the databox appeared, and publish to save your changes.


Edit Databox data

[meckotcita ka itactek]

Sometimes data may be incorrect or outdated and needs to be changed or updated, but you cannot do that from the current page. Data seen in the databox is not stored locally, it is transcluded from Wikidata.

To change or edit data shown in databox:

  1. Click the pencil icon An icon from the OOjs UI lib. next to the statement in the databox.
  2. This will take you to where on the Wikidata item the statement is stored.
  3. Click the pencil icon An icon from the OOjs UI lib. again, on the side of the Statement box. This opens the edit mode on Wikidata.
    • Enter the new value in the input field. Add qualifiers or references as appropriate.
    • If the value is outdated but still correct (such as Census data), click the + icon to the right of the pencil icon instead, and enter the latest or newest value.
  4. Click the tick/checkmark button to publish the statement. The databox will immediately update and the new information will appear.


Databox examples

[meckotcita ka itactek]
{{Databox|item=Q42}}
Douglas Adams
nehirowisiw
Awin miairiniw Meckotcita
Askik iriniwRoyaume-Uni Meckotcita
Atikamekw icinikasowinDouglas Adams Meckotcita
Nom de naissanceDouglas Noël Adams Meckotcita
E icinikasotcDouglas, Noël Meckotcita
E ici wirakaniwitcAdams Meckotcita
PseudonymeDavid Agnew Meckotcita
Nom courtDouglas Adams Meckotcita
Pitc ka nitawokitc11 Nikikw pisimw 1952 Meckotcita
Taci we otcitcCambridge Meckotcita
Pitc ka ponipimatsitc11 Wapikon pisimw 2001 Meckotcita
Taci ka tci ponimatisitcSanta Barbara Meckotcita
Circonstances de la mortcauses naturelles Meckotcita
Cause de la mortinfarctus du myocarde Meckotcita
Lieu de sépulturecimetière de Highgate Meckotcita
OtawiwaChristopher Douglas Adams Meckotcita
MèreJanet Adams Meckotcita
WitcicanSusan Adams Meckotcita
OtiskwemaJane Belson Meckotcita
OnitcanicaPolly Jane Rocket Adams Meckotcita
Langue maternelleanglais Meckotcita
Tan e ici arimowetc, e ici masinahiketcanglais Meckotcita
Langues d'écritureanglais Meckotcita
Domaine d'activitélittérature de science-fiction Meckotcita
Employé(e) parBBC, The Digital Village Meckotcita
KiskinohamasowinBrentwood School, St John's College Meckotcita
OtenawCambridge, Londres, Brentwood, Santa Barbara Meckotcita
Lieu de travailLondres Meckotcita
Début de la période d'activité1974 Meckotcita
Awin nehirowisiwWhite British Meckotcita
Aiamihewinathéisme Meckotcita
Couleur des yeuxbrun Meckotcita
Instrument de musique pratiquépapowapikepitcikan Meckotcita
Œuvre notableLe Guide du voyageur galactique, Dirk Gently, détective holistique, La Vie privée de Gengis Khan Meckotcita
Archives conservées parSt John's College Library Meckotcita
Membre deCambridge Footlights, Groucho Club Meckotcita
Genrescience-fiction, comédie, satire Meckotcita
Distinction reçueprix Inkpot, Ditmar Award for Best International Fiction Meckotcita
Nommé ou nommée pourprix Hugo de la meilleure présentation dramatique, prix Locus du meilleur roman de science-fiction Meckotcita
Tecipitakanhttps://douglasadams.com Meckotcita
Décrit à l'URLhttps://baike.sogou.com/v367134.htm Meckotcita
Catégorie liéeCategory:Films with screenplays by Douglas Adams Meckotcita
Statut des droits d'auteur du créateur ou de la créatriceœuvre sous droits d'auteurs Meckotcita

The examples below show how the databox template can appear in the edit source view.

  • {{Databox}}
Default choice. It will retrieve data from the Wikidata item connected to the page.


  • {{Databox|item=Q123}}
Forces the databox to retrieve data from a specified Wikidata item. This can be a different item than the one connected/sitelinked to the page, but it cannot be both. Databox data can only be retrieved from one item.


  • {{Databox|useImage=filename.jpg}}
Manually specify another image (P18) to display in the databox.


  • {{Databox|excludeProperties=P123}}
Specify a comma-separated list of Wikidata properties (PID's) that should not be shown in the current databox.


  • {{Databox|useImage=filename.jpg|excludeProperties=P123}}
Combining parameters allows more content control.


Aucune description.

Paramètres du modèle

ParamètreE witcikemakakTypeÉtat
useImageuseImage

File name for the preferred image to use from Wikidata Entity

Chaînefacultatif
excludePropertiesexcludeProperties

Comma separated list of Wikidata Property Ids to remove from the databox

Chaînefacultatif


How to use the new parameters

[meckotcita ka itactek]

Step-by-step instructions to invoke and use the additional Databox parameters.

  1. Open the edit source view of a page you want to add Databox to, or edit an existing one.
  2. Add the code: |useImage=to the {{Databox}} template.
  3. Navigate to the Wikidata item of the connected databox, and find the Image (P18) statement. Tip: you can add #P18 to the of the Wikidata item URL to quickly navigate to it.
  4. To use a different image (locally) than the currently applied one, locate the filename (underneath the image itself) and highlight it and copy it (Ctrl+C)
  5. Navigate back to the page where you are invoking the {{Databox|useImage=}} and paste (Ctrl+V) the copied filename into the template.
  6. The template code should now look like:
    {{Databox|useImage=highlighted_text.jpg}}
  7. Preview the changes to see the new image in the Databox, and publish the page to save your changes.

excludeProperties

[meckotcita ka itactek]
  1. Add a {{Databox}} to a page or view an existing one, and notedown the Property ID/number of the rows and data you wish to hide from the local databox.
    1. You can do this quickly by hovering the mouse-cursor over the icon on the corresponding row of the databox.
    2. In the bottom of your browser-window, the URL of the corresponding property will be previewed, locate and notedown the PID of that URL.
      Example: if the URL looks like
      www.wikidata.org/wiki/Q123456#P789, notedown P789.
    3. Do the same for all rows/properties that are to be hidden.
  2. Add the code:
    |excludeProperties=to the {{Databox}} template.
  3. Add the Property ID/numbers to the databox template code, separated by a comma , e.g.
    {{Databox|excludeProperties=P789,P123,P456}}
  4. Preview the changes to ensure the rows have been hidden from the databox, and publish the page to save your changes.

Please remember: This parameter only hides the property data, it does not remove or delete it and will not affect any other Databoxes on the local or other Wikis.