Template:WikiLink
Renders a link to the article name in Wikipedia corresponding to a Wikidata QID
Usage
{{WikiLink |qid= |lang= |display= |notfound= }}
Links to the article in the preferred language if available, or in English if not. As a fallback, links to the Wikidata entry. If available, the Wikidata label name in the target language is shown if the display name is not given. Usually, but not always, this is the same as the name of the article in the target Wikipedia. There are exceptions. For example, as of June 2019
- The Wikidata English label for Q180 was
Wikimedia Foundation, Inc.
, while the Wikipedia:en name wasWikimedia Foundation
. - The Wikidata English label for Q861013 was
Image copyright
, while the Wikipedia:en name wasPhotograph copyright (Germany)
. - The Wikidata Chinese label for Q22668 was
最小惊讶原则
, but there was no Chinese Wikipedia entry - The Wikidata English label for Q314956 was
right to image
, but there was no English Wikipedia entry
If there is no translation of the Wikidata label into the target language the default version is given, usually English.
Typically this template is called from a "container" template such as {{Wp-Public domain}}.
The advantage over hard coded links like [[w:en:pagename]]
or {{w|pagename||en}}
is that translators do not have to check what the target page is called in their language, or even whether it exists in their language. The link will start to point to a version in their language as soon as that version is created. The drawback is that a container template is needed for each Wikidata label to map from the target name to its QID, similar to a multilingual tag for a location.
Template parameters
Parameter | Description | Default | Status | |
---|---|---|---|---|
qid | Qid | Wikidata identifier | empty | required |
lang | language | Language to link Wikipedia in (and show label in, if not overridden) | en | optional |
display | link text | Name to display in the link | Translated Wikidata label | optional |
notfound | no translation warning | Text to add in brackets parentheses if request language was not English, but link is to English version | empty | optional |
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard. Existing template documentation Newly created template documentation and imports Wikipedia's help about TemplateData • Commons-specific information Renders a link to the article name in Wikipedia corresponding to a Wikidata QID
|
Additional information
The template is intended to be used in the following namespaces: the Commons namespace
The template is intended to be used by the following user groups: all users
Relies on:
See also
Localization
This template is not intended to be localized.
Examples
Code | Result |
---|---|
{{WikiLink|qid=Q180}}
|
Wikimedia Foundation |
{{WikiLink|qid=Q180|display=abc}}
|
abc |
{{WikiLink|qid=Q180|lang=ar}}
|
مؤسسة ويكيميديا |
{{WikiLink|qid=Q180|lang=ar|display=abc}}
|
abc |
{{WikiLink|qid=Q180|lang=ar|notfound=in English}}
|
مؤسسة ويكيميديا |
{{WikiLink|qid=Q5578397}}
|
Golan v. Holder |
{{WikiLink|qid=Q5578397|lang=vo}}
|
Golan v. Holder |
{{WikiLink|qid=Q5578397|lang=vo|notfound=in English}}
|
Golan v. Holder [in English] |