Template:Commons category-inline: Difference between revisions
From Zoophilia Wiki
Jump to navigationJump to search
meta>RexxS replace use of module sandbox with main module |
meta>Mike Peel Removing P373 support to only use the sitelinks |
||
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}}<!-- | -->|{{if then show|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=false}}<!-- | ||
... 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}}|Category:|}}<!-- | -->|{{if then show|{{#invoke:String|replace|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=false}}|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|}}}|_| }}|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True}}|<!-- | -->{{#if:{{{1|}}}|{{#ifeq:Category:{{replace|{{{1|}}}|_| }}|{{#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 | ||
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> | |||
{{Documentation}} | {{Documentation}} | ||
<!-- Add categories to the /doc subpage, not here! --> | <!-- Add categories to the /doc subpage, not here! --> | ||
</noinclude> | </noinclude> |
Revision as of 20:02, 15 June 2019
File:Commons-logo.svg Media related to [[commons:Template:If then show|Template:If then show]] at Wikimedia Commons