Template:Commons category-inline: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Mike Peel
(Adding nowrap, lcfirst parameters from Template:Commons category)
meta>Mike Peel
(Changing tracking category logic so that we only use the P373 cases where we have actually fallen back to P373, rather than using the local text. No change to the display of the category links.)
Line 25: Line 25:
--><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}}|<!--
  -->{{#if:{{{1|}}}|{{#ifeq:Category:{{replace|{{{1|}}}|_|&#32;}}|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=False}}|<!--
   -->[[Category:Commons category link is on Wikidata]]<!--
   -->[[Category:Commons category link is on Wikidata]]<!--


Line 36: Line 36:


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


   ... so we're using Wikidata
   ... so we're using Wikidata
   -->[[Category:Commons category link from Wikidata]]<!--
   -->[[Category:Commons category link from Wikidata]]<!--


  ... or we've fallen back to the pagename
    <!-- ... or we're using P373
  -->|[[Category:Commons category link is the pagename]]}}
    -->|{{#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]]<!--
  }}<!-- 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>
    ... or we've fallen back to the pagename
    -->|[[Category:Commons category link is the pagename]]}}
  }}
  }}
  }}</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 10:13, 11 April 2020

Media related to [[commons:Template:If then show|Template:If then show]] at Wikimedia Commons