Jump to content

User:Opencooper/wikidataDescription

From Wikipedia, the free encyclopedia

This is the current revision of this page, as edited by Opencooper (talk | contribs) at 04:34, 1 December 2019 (→‎top: update). The present address (URL) is a permanent link to this version.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

wikidataDescription.js displays the current article's description in Wikidata. This brings it in parity with the mobile site and apps. Additionally, clicking the description shows additional information such as a short description, if found. If the article does not have an associated Wikidata item, it will show "[No Wikidata]", and if the description is empty, "[No desc.]".

Installation[edit]

To install the script, add the following to your common.js page:

importScript('User:Opencooper/wikidataDescription.js'); // Backlink: [[User:Opencooper/wikidataDescription.js]]

Styling[edit]

To change the look of the descriptions with CSS, target the #wikidataDescription and #shortDescriptionInfo ids in your common.css page. For example, to hide the "[short description]" shown after short descriptions:

#shortDescriptionInfo small {
	display: none;
}

License[edit]

This script and any associated files are licensed under Creative Commons Zero.