Template:Wikidata fallback link/doc

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

This template (previously called Template:Wikidata red link) takes a Wikidata entity number as an unnamed parameter and provides a link to the corresponding article on the English Wikipedia, or its Wikidata entity depending on whether the article exists or not.

Article exists

[edit source]

If the corresponding article exists then a direct link to the article is given (piped to the label on Wikidata).

Article does not exist

[edit source]

If the corresponding article does not exist on the English Wikipedia, then a red link is displayed, followed by a link to its item on Wikidata.

  • {{Wikidata fallback link|Q1897508}} → [[Lua error in Module:Wd at line 633: attempt to index field 'wikibase' (a nil value).]] 
    Explanation: There is no English Wikipedia article yet for this insect, so a red link is displayed.
  • {{Wikidata fallback link|Q31692001}} → [[Lua error in Module:Wd at line 633: attempt to index field 'wikibase' (a nil value).]] 
    Explanation: There is no English Wikipedia article yet for this mountain, so a red link is displayed.

To suppress the link to Wikidata use |wd=off, e.g.

  • {{Wikidata fallback link|Q31692001|wd=off}} → [[Lua error in Module:Wd at line 633: attempt to index field 'wikibase' (a nil value).]] 
    Explanation: The link to Wikidata is not displayed now.

Label exists but article under that title already exists

[edit source]

If the corresponding article does not exist on the English Wikipedia but there is a different article at the item's label, then to avoid confusion, the label is not linked.

  • {{Wikidata fallback link|Q2542189}} → [[Lua error in Module:Wd at line 633: attempt to index field 'wikibase' (a nil value).]] 
    Explanation: there is no English Wikipedia article for this fictional character "Ali", but the page Ali already exists (cousin of the prophet Muhammad) so no link is provided.
  • {{Wikidata fallback link|Q18977043}} → [[Lua error in Module:Wd at line 633: attempt to index field 'wikibase' (a nil value).]] 
    Explanation: there is no English Wikipedia article for the Dutch street "Bult", but the page Bult already exists (commune in France) so no link is provided.

Article exists but is a redirect to the current page

[edit source]

Per WP:SELFRED, if the corresponding article exists but is a redirect to the current page, the label is not linked when the |r=1 parameter is supplied. If the |r=1 parameter is not supplied, the self-redirect is linked as usual.

Example: See Template:Wikidata fallback link/testcases#Article exists but is a redirect to the current page

No label defined

[edit source]

If there is no English label defined on Wikidata, then just a link to the Wikidata item is displayed. To fix this, please add a label to the Wikidata item.


The OOjs UI pen icon can be used instead of the [Wikidata] link.

See also

[edit source]
  • {{interlanguage link}} which provides overlapping functionality
  • {{get QID|<Wikipedia page title>}} gives the qid from the sitelink
  • {{wikidata entity link}} (Shortcut: {{Q|<qid>}}) shows the Wikidata label and link, and links to the Wikidata page
  • {{interwiki extra}} for adding interwiki links from a "fallback" Wikidata item