Changes
add doc string for fallback parameter
{{Module rating|release}}
== Usage ==
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGallery}}</code>
:Use wikidata to find Commons gallery corresponding to this article. If unable to find gallery in wikidata, default to searching for PAGENAME in Commons.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGallery|title|linktext=text}}</code>
:Link to Commons gallery at <code>title</code>. Optionally, use <code>text</code> as displayed link text.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGallery|search=string|linktext=text}}</code>
:Link to Commons search for <code>string</code>. Optionally, use <code>text</code> as displayed link text.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory|fallback=string|linktext=text}}</code>
:Use wikidata first, then if failure, use Commons search for <code>string</code>. Optionally, use <code>text</code> as displayed link text.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory}}</code>
: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.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory|title|linktext=text}}</code>
:Link to Commons category at <code>Category:title</code>. Optionally, use <code>text</code> as displayed link text.
<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.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory|fallback=string|linktext=text}}</code>
:Use wikidata first, then if failure, use 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. Other arguments as above.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGalleryAndCategory}}</code>
:Lua to implement {{tl|commons and category}}: return Commons gallery, Commons category, or both (if both found)
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGalleryAndCategory|GalleryName|CategoryName}}</code>
:Either GalleryName or CategoryName or both can be supplied, will override wikidata search
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|bold=1|italic=1}}</code>
:Format of first link can be specified (bold or italic or both)
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|linktext=link|categoryText=category}}</code>
:Text in the first link, and the second (category) link can be overridden, also.
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
[[Category:Wikidata modules]]
}}</includeonly>
== Usage ==
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGallery}}</code>
:Use wikidata to find Commons gallery corresponding to this article. If unable to find gallery in wikidata, default to searching for PAGENAME in Commons.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGallery|title|linktext=text}}</code>
:Link to Commons gallery at <code>title</code>. Optionally, use <code>text</code> as displayed link text.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGallery|search=string|linktext=text}}</code>
:Link to Commons search for <code>string</code>. Optionally, use <code>text</code> as displayed link text.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory|fallback=string|linktext=text}}</code>
:Use wikidata first, then if failure, use Commons search for <code>string</code>. Optionally, use <code>text</code> as displayed link text.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory}}</code>
: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.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory|title|linktext=text}}</code>
:Link to Commons category at <code>Category:title</code>. Optionally, use <code>text</code> as displayed link text.
<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.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getCategory|fallback=string|linktext=text}}</code>
:Use wikidata first, then if failure, use 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. Other arguments as above.
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGalleryAndCategory}}</code>
:Lua to implement {{tl|commons and category}}: return Commons gallery, Commons category, or both (if both found)
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|getGalleryAndCategory|GalleryName|CategoryName}}</code>
:Either GalleryName or CategoryName or both can be supplied, will override wikidata search
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|bold=1|italic=1}}</code>
:Format of first link can be specified (bold or italic or both)
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|linktext=link|categoryText=category}}</code>
:Text in the first link, and the second (category) link can be overridden, also.
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
[[Category:Wikidata modules]]
}}</includeonly>