Template:Wikidata entity link: Difference between revisions

From Vigyanwiki
Template>Amire80
(+ TemplateData)
Template>Uzume
Line 1: Line 1:
<includeonly>{{#if: {{{1|}}}
<includeonly>{{#if: {{{1|}}}
| {{#switch: {{uc:{{padleft:|1|{{#if:1|{{{1}}}}}}}}}
| {{#switch: {{uc:{{padleft:|1|{{#if:1|{{{1}}}}}}}}}
   | P = [[d:Property:{{#if:1|{{{1}}}}}|{{#invoke:Wikibase|label|{{{1}}}}} <small>({{#if:1|{{{1}}}}})</small>]]
   | Q | P = [[d:Special:EntityPage/{{#if:1|{{{1}}}}}|{{#invoke:wd|label|{{{1}}}}} <small>({{#if:1|{{{1}}}}})</small>]]
  | Q = [[d:{{#if:1|{{{1}}}}}|{{#invoke:Wikibase|label|{{{1}}}}} <small>({{#if:1|{{{1}}}}})</small>]]
   | #default = [[d:Special:EntityPage/Q{{#if:1|{{{1}}}}}|{{#invoke:wd|label|Q{{#if:1|{{{1}}}}}}} <small>(Q{{#if:1|{{{1|}}}}})</small>]]
   | #default = [[d:Q{{#if:1|{{{1}}}}}|{{#invoke:Wikibase|label|Q{{#if:1|{{{1}}}}}}} <small>(Q{{#if:1|{{{1|}}}}})</small>]]
   }}
   }}
| {{#ifeq: {{#invoke:Wikibase|id}} | no entity
| {{#if:{{#invoke:wd|label|raw}}
  | [[d:Special:EntityPage/{{#invoke:wd|label|raw}}|{{#invoke:wd|label}} <small>({{#invoke:wd|label|raw}})</small>]]
   | <small>(no entity)</small>
   | <small>(no entity)</small>
  | [[d:{{#invoke:Wikibase|id}}|{{#invoke:Wikibase|label}} <small>({{#invoke:Wikibase|id}})</small>]]
   }}
   }}
}}</includeonly><noinclude>
}}</includeonly><noinclude>{{Documentation}}</noinclude>
{{Documentation}}
<templatedata>
{
"params": {
"1": {
"label": "iterm or property number",
"description": "The letter P is required when linking to properties. The letter Q is optional when linking to items.",
"example": "Q42, 42, P23",
"type": "line",
"suggested": true
}
}
}
</templatedata></noinclude>

Revision as of 22:17, 23 April 2020

Template documentation