Changes
Updated to use interwiki links instead of external links, see Template talk:Wikidata entity link#Link format. Tested first with /sandbox and /testcases.
<includeonly>{{#if: {{{1|}}}
| {{#switch: {{uc:{{padleft:|1|{{#if:1|{{{1}}}}}}}}}
| P = [[d:Property:{{#if:1|{{{1}}}}}|{{#invoke:Wikibase|label|{{{1}}}}} <small>({{#if:1|{{{1}}}}})</small>]]
| Q = [[d:{{#if:1|{{{1}}}}}|{{#invoke:Wikibase|label|{{{1}}}}} <small>({{#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
| <small>(no entity)</small>
| [[d:{{#invoke:Wikibase|id}}|{{#invoke:Wikibase|label}} <small>({{#invoke:Wikibase|id}})</small>]]
}}
}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
| {{#switch: {{uc:{{padleft:|1|{{#if:1|{{{1}}}}}}}}}
| P = [[d:Property:{{#if:1|{{{1}}}}}|{{#invoke:Wikibase|label|{{{1}}}}} <small>({{#if:1|{{{1}}}}})</small>]]
| Q = [[d:{{#if:1|{{{1}}}}}|{{#invoke:Wikibase|label|{{{1}}}}} <small>({{#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
| <small>(no entity)</small>
| [[d:{{#invoke:Wikibase|id}}|{{#invoke:Wikibase|label}} <small>({{#invoke:Wikibase|id}})</small>]]
}}
}}</includeonly><noinclude>
{{Documentation}}
</noinclude>