Template:Commons category: Difference between revisions

Undid revision 901998205 by Mike Peel (talk) - restore for now
(Removing P373 support to only use the sitelinks)
(Undid revision 901998205 by Mike Peel (talk) - restore for now)
Line 6:
-->{{#if:{{{1|}}} | Category:{{{1|}}} <!--
... or use Wikidata
-->|{{if then show|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=false}}<!--
... or fall back to the page name
--> |Category:{{PAGENAME}} }} }}
<!-- Display title -->
| 2 = {{{2|{{#if:{{{1|}}} | {{{1|}}} <!--
-->|{{if then show|{{#invoke:String|replace|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=false}}|Category:|}}<!--
--> |{{PAGENAME}} }} }} }}}
}}<!--
Line 18:
--><includeonly>{{#switch:{{NAMESPACE}}||{{ns:14}}=<!--
Only add tracking categories to articles and categories.
-->{{#if:{{{1|}}}|{{#ifeq:Category:{{replace|{{{1|}}}|_|&#32;}}|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=false}}|<!--
-->[[Category:Commons category link is on Wikidata]]<!--
 
Line 29:
 
We don't have a locally-defined link
-->|{{#if:{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=false}}|<!--
 
... so we're using Wikidata
Line 36:
... or we've fallen back to the pagename
-->|[[Category:Commons category link is the pagename]]}}
}}<!-- Check for P373 use
}} }}</includeonly><noinclude>
-->{{#ifeq:{{#invoke:WikidataIB |getCommonsLink |qid={{{qid|}}}|onlycat=True|fallback=True}}|{{#invoke:WikidataIB |getCommonsLink |qid={{{qid|}}}|onlycat=True|fallback=False}}||[[Category:Commons category link is on Wikidata using P373]]}} }}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage, not here! -->
Anonymous user