Difference between revisions of "Module:Commons link/doc"
Jump to navigation
Jump to search
blackwiki>Hike395 (upgrade to beta) |
blackwiki>Hike395 (+1 entry point) |
||
| Line 19: | Line 19: | ||
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory|search=string|linktext=text}}</code> | <code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory|search=string|linktext=text}}</code> | ||
:Link to Commons search for <code>Category:string</code>. Optionally, use <code>text</code> as displayed link text. | :Link to Commons search for <code>Category:string</code>. Optionally, use <code>text</code> as displayed link text. | ||
| + | |||
| + | <code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGalleryOrCategory}}</code> | ||
| + | :Use wikidata to find "best" single Commons link: try gallery first, fall back to category. | ||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | | <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | | ||
Revision as of 05:12, 16 March 2020
| This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected. |
Usage
{{#invoke:Commons link|getGallery}}
- Use wikidata to find Commons gallery corresponding to this article. If unable to find gallery in wikidata, default to searching for PAGENAME in Commons.
{{#invoke:Commons link|getGallery|title|linktext=text}}
- Link to Commons gallery at
title. Optionally, usetextas displayed link text.
{{#invoke:Commons link|getGallery|search=string|linktext=text}}
- Link to Commons search for
string. Optionally, usetextas displayed link text.
{{#invoke:Commons link|getCategory}}
- Use wikidata to find Commons category corresponding to this article. If unable to find category in wikidata, default to searching for Category:PAGENAME in Commons.
{{#invoke:Commons link|getCategory|title|linktext=text}}
- Link to Commons category at
Category:title. Optionally, usetextas displayed link text.
{{#invoke:Commons link|getCategory|search=string|linktext=text}}
- Link to Commons search for
Category:string. Optionally, usetextas displayed link text.
{{#invoke:Commons link|getGalleryOrCategory}}
- Use wikidata to find "best" single Commons link: try gallery first, fall back to category.