Template:Commons category: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Mike Peel
(Removing P373 support to only use the sitelinks)
meta>Mike Peel
(Undid revision 901998205 by Mike Peel (talk) - restore for now)
Line 6: Line 6:
  -->{{#if:{{{1|}}} | Category:{{{1|}}} <!--
  -->{{#if:{{{1|}}} | Category:{{{1|}}} <!--
   ... or use Wikidata
   ... or use Wikidata
   -->|{{if then show|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=false}}<!--
   -->|{{if then show|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True}}<!--
   ... or fall back to the page name
   ... or fall back to the page name
   --> |Category:{{PAGENAME}} }} }}
   --> |Category:{{PAGENAME}} }} }}
<!-- Display title -->
<!-- Display title -->
| 2 = {{{2|{{#if:{{{1|}}} | {{{1|}}} <!--
| 2 = {{{2|{{#if:{{{1|}}} | {{{1|}}} <!--
   -->|{{if then show|{{#invoke:String|replace|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=false}}|Category:|}}<!--
   -->|{{if then show|{{#invoke:String|replace|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True}}|Category:|}}<!--
   --> |{{PAGENAME}} }} }} }}}
   --> |{{PAGENAME}} }} }} }}}
}}<!--
}}<!--
Line 18: Line 18:
--><includeonly>{{#switch:{{NAMESPACE}}||{{ns:14}}=<!--
--><includeonly>{{#switch:{{NAMESPACE}}||{{ns:14}}=<!--
  Only add tracking categories to articles and categories.
  Only add tracking categories to articles and categories.
  -->{{#if:{{{1|}}}|{{#ifeq:Category:{{replace|{{{1|}}}|_|&#32;}}|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=false}}|<!--
  -->{{#if:{{{1|}}}|{{#ifeq:Category:{{replace|{{{1|}}}|_|&#32;}}|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True}}|<!--
   -->[[Category:Commons category link is on Wikidata]]<!--
   -->[[Category:Commons category link is on Wikidata]]<!--


Line 29: Line 29:


   We don't have a locally-defined link  
   We don't have a locally-defined link  
   -->|{{#if:{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=false}}|<!--
   -->|{{#if:{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True}}|<!--


   ... so we're using Wikidata
   ... so we're using Wikidata
Line 36: Line 36:
   ... or we've fallen back to the pagename
   ... or we've fallen back to the pagename
   -->|[[Category:Commons category link is the pagename]]}}
   -->|[[Category:Commons category link is the pagename]]}}
   }} }}</includeonly><noinclude>
   }}<!-- Check for P373 use
-->{{#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}}
{{Documentation}}
<!-- Add categories to the /doc subpage, not here! -->
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
</noinclude>

Revision as of 09:40, 20 June 2019

Template:Commons