Jump to content

Module:EditAtWikidata/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
+cats
Line 1: Line 1:
{{Module rating |protected}}
{{Module rating |protected}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
<!-- Please place template categories where indicated at the bottom of this page. -->
{{high use|1134971}}
{{high use|1134971}}
{{Lua sidebar}}
{{Lua sidebar}}
Line 10: Line 10:


== Usage ==
== Usage ==

To always display the icon:
To always display the icon:
* <code><nowiki>{{#invoke:EditAtWikidata|showMessage}}</nowiki></code>
* <code><nowiki>{{#invoke:EditAtWikidata|showMessage}}</nowiki></code>
Line 27: Line 26:
* [[Template:EditAtWikidata]]
* [[Template:EditAtWikidata]]


<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
<!-- Template categories below this line, please -->
[[Category:Wikidata modules]]

[[Category:Modules using data from Wikidata]]
}}</includeonly>
}}</includeonly>

Revision as of 18:40, 5 May 2020

Module to display an icon with a tooltip such as "Edit this at Wikidata"

  • Icon will be linked to the Wikidata entry for the article where this is placed.
  • This message is only displayed if a local_parameter is not supplied, i.e. when called from a template, it can be coded not to display the message when a local parameter is in use, preventing the value form Wikidata being fetched.
  • The qid of a Wikidata entry can optionally be supplied for testing outside the article.

Usage

To always display the icon:

  • {{#invoke:EditAtWikidata|showMessage}}

To display the icon depending on a local parameter not existing:

  • {{#invoke:EditAtWikidata|showMessage|local_parameter}}

To test the functionality outside of an article:

  • {{#invoke:EditAtWikidata|showMessage|qid=<ArticleID>|local_parameter}}

To make the link point to the given property at the Wikidata entry:

  • {{#invoke:EditAtWikidata|showMessage|pid=<PropertyID>|local_parameter}}

See also