Module:Commons link/doc explained

For testing the sandbox, see .

Usage

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|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.

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGallery|title|linktext=text}}

Link to Commons gallery at title. Optionally, use text as displayed link text.

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGallery|search=string|linktext=text}}

Link to Commons search for string. Optionally, use text as displayed link text.

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory|fallback=string|linktext=text}}

Use wikidata first, then if failure, use Commons search for string. Optionally, use text as displayed link text.

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|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.

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory|title|linktext=text}}

Link to Commons category at Category:title. Optionally, use text as displayed link text.

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory|search=string|linktext=text}}

Link to Commons search for Category:string. Optionally, use text as displayed link text.

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory|fallback=string|linktext=text}}

Use wikidata first, then if failure, use Commons search for Category:string. Optionally, use text as displayed link text.

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGalleryOrCategory}}

Use wikidata to find "best" single Commons link: try gallery first, fall back to category. Other arguments as above.

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGalleryAndCategory}}

Lua to implement : return Commons gallery, Commons category, or both (if both found)

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGalleryAndCategory|GalleryName|CategoryName}}

Either GalleryName or CategoryName or both can be supplied, will override wikidata search

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|bold=1|italic=1|nowrap=1|lcfirst=1}}

Format of first link can be specified (any combination of bold, italic, nowrap, and lower-case first character)

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|linktext=link|categoryText=category}}

Text in the first link, and the second (category) link can be overridden, also.

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|tracking=1}}

Module can generate tracking categories for mismatch between supplied arguments and Wikidata.