Template:Commons category-inline: 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 901999529 by Mike Peel (talk) - restore for now)
Line 8: Line 8:
  -->{{#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}}}}}}<!--
   Now define the display title
   Now define the display title
   -->|{{{2|{{#if:{{{1|}}}|{{{1|}}}<!--
   -->|{{{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 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|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 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|fallback=false}}|<!--
   -->|{{#if:{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True}}|<!--


   ... so we're using Wikidata
   ... so we're using Wikidata
Line 39: Line 39:
   ... 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

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