Difference between revisions of "Template:Commons and category/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>Hike395
(rm stray braces)
imported>Hike395
(convert to positional arguments)
 
Line 4: Line 4:
 
|text = [[Wikimedia Commons]] has media related to:
 
|text = [[Wikimedia Commons]] has media related to:
 
<div style="margin-left: 10px;"><!--
 
<div style="margin-left: 10px;"><!--
-->{{#invoke:Commons link/sandbox|getGalleryAndCategory|gallery={{{1|}}}|category={{{2|}}}|<!--
+
-->{{#invoke:Commons link/sandbox|getGalleryAndCategory|{{{1|}}}|{{{2|}}}|<!--
 
       -->qid={{{qid|}}}|bold=1|italic=1}}</div>}}<!--
 
       -->qid={{{qid|}}}|bold=1|italic=1}}</div>}}<!--
  Tracking categories
 
-->{{#if:{{{1|}}}||{{main other|[[Category:Commons+cat gallery link from pagename]]}}}}<!--
 
-->{{#if:{{{2|}}}||{{main other|[[Category:Commons+cat category link from pagename]]}}}}<!--
 
 
--><noinclude>
 
--><noinclude>
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 00:57, 23 March 2020

Template:Sister project

Template documentation[view] [edit] [history] [purge]

Usage

Sometimes articles have both Commons articles (galleries) and categories about them. This template can be used to generate a right-aligned (default) message box link to a Commons gallery and a Commons category. It is intended for use in the "External links" section of an article.

Format

{{Commons and category|CommonsGalleryName|CommonsCategoryName}}

Please note that the Commons gallery (1st parameter) or the Commons category (2nd parameter) are both optional: if either is left blank, the template will search for them in Wikidata. There is also an optional parameter for |position=.

Examples

{{Commons and category|Automobile|Automobiles}}

Template:Sister project

{{Commons and category}} when placed on Car (gallery and category both in wikidata):

Template:Sister project

{{Commons and category}} when placed on Beinn an Dòthaidh (only category in wikidata):

Template:Sister project

{{Commons and category}} when placed on Samuel Baker House (only gallery in wikidata):

Template:Sister project

{{Commons and category}} when placed on Chicago Lawn, Chicago (neither gallery nor category in wikidata):

Template:Sister project

See also