Difference between revisions of "Template:EditOnWikidata/doc"

From blackwiki
Jump to navigation Jump to search
imported>RexxS
(create documentation)
 
imported>Jonesey95
(Fix Linter errors)
 
(4 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
Template to add "edit on Wikidata" tag in Wikidata-driven infoboxes
 
Template to add "edit on Wikidata" tag in Wikidata-driven infoboxes
 +
 +
If the infobox passes a {{para|noicon}} parameter, then this link will not be displayed when <code>noicon</code> is set to <code>false</code> or <code>no</code>.
 +
 +
The default can be set at the infobox level by coding as either:
 +
* <code><nowiki>| data100 = {{EditOnWikidata|noicon={{{noicon|true}}}}}</nowiki></code> → which displays the link in an article when <code>noicon</code> is omitted
 +
* <code><nowiki>| data100 = {{EditOnWikidata|noicon={{{noicon|false}}}}}</nowiki></code> → which suppresses the link in an article when <code>noicon</code> is omitted
 +
 +
This functionality is the opposite to the noicon parameter of [[Module:WikidataIB]] - so if you set noicon=True and pass it to both the module and this template, you will only see this template. If you pass noicon=False, this template will be hidden while {{EditAtWikidata|qid=Q1513315}} will show next to the items fetched from Wikidata in the infobox.
 +
 +
You can specify '''qid=''' to link to a specific Wikidata ID if needed (i.e., in page drafts).
 +
 
== Usage ==
 
== Usage ==
 +
{| class="wikitable"
 +
! scope="col" style="width:50%;" | Code
 +
! scope="col" style="width:50%;" | Result
 +
|-
 +
| <code><nowiki>{{EditOnWikidata}}</nowiki></code>              || {{EditOnWikidata}}
 +
|-
 +
| <code><nowiki>{{EditOnWikidata|noicon=true}}</nowiki></code>  || {{EditOnWikidata|noicon=true}}
 +
|-
 +
| <code><nowiki>{{EditOnWikidata|noicon=yes}}</nowiki></code>  || {{EditOnWikidata|noicon=yes}}
 +
|-
 +
| <code><nowiki>{{EditOnWikidata|noicon=false}}</nowiki></code> || {{EditOnWikidata|noicon=false}}
 +
|-
 +
| <code><nowiki>{{EditOnWikidata|noicon=no}}</nowiki></code>    || {{EditOnWikidata|noicon=no}}
 +
|}
 +
 +
 +
== See also ==
 +
* [[Template:EditAtWikidata]], a similar template using an icon instead of text
  
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||

Latest revision as of 21:55, 16 March 2019

Template to add "edit on Wikidata" tag in Wikidata-driven infoboxes

If the infobox passes a |noicon= parameter, then this link will not be displayed when noicon is set to false or no.

The default can be set at the infobox level by coding as either:

  • | data100 = {{EditOnWikidata|noicon={{{noicon|true}}}}} → which displays the link in an article when noicon is omitted
  • | data100 = {{EditOnWikidata|noicon={{{noicon|false}}}}} → which suppresses the link in an article when noicon is omitted

This functionality is the opposite to the noicon parameter of Module:WikidataIB - so if you set noicon=True and pass it to both the module and this template, you will only see this template. If you pass noicon=False, this template will be hidden while Script error: No such module "EditAtWikidata". will show next to the items fetched from Wikidata in the infobox.

You can specify qid= to link to a specific Wikidata ID if needed (i.e., in page drafts).

Usage

Code Result
{{EditOnWikidata}}
{{EditOnWikidata|noicon=true}}
{{EditOnWikidata|noicon=yes}}
{{EditOnWikidata|noicon=false}}
{{EditOnWikidata|noicon=no}}


See also