Template:Commons category: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Mike Peel
Adding lcfirst and nowrap display options
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 21: Line 21:
--><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 32: Line 32:


   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:12, 11 April 2020

Template:Commons