Difference between revisions of "Template:Commons and category/doc"
Jump to navigation
Jump to search
imported>Hike395 (→Usage: update) |
imported>Hike395 (expand documentation to cover new behavior) |
||
| Line 8: | Line 8: | ||
===Format=== | ===Format=== | ||
:{{tlx|Commons and category|<var>CommonsGalleryName</var>|<var>CommonsCategoryName</var>}} | :{{tlx|Commons and category|<var>CommonsGalleryName</var>|<var>CommonsCategoryName</var>}} | ||
| − | Please note that | + | 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 {{para|position}}. |
| − | == | + | ==Examples== |
:{{tlx|Commons and category|<var>Automobile</var>|<var>Automobiles</var>}} | :{{tlx|Commons and category|<var>Automobile</var>|<var>Automobiles</var>}} | ||
{{Commons and category|Automobile|Automobiles}} | {{Commons and category|Automobile|Automobiles}} | ||
| + | {{clear right}} | ||
| + | :{{tlx|Commons and category}} when placed on [[Car]] (gallery and category both in wikidata): | ||
| + | {{Commons and category|qid=Q1420}} | ||
| + | {{clear right}} | ||
| + | :{{tlx|Commons and category}} when placed on [[Beinn an Dòthaidh]] (only category in wikidata): | ||
| + | {{Commons and category|qid=Q4881355}} | ||
| + | {{clear right}} | ||
| + | :{{tlx|Commons and category}} when placed on [[Samuel Baker House]] (only gallery in wikidata): | ||
| + | {{Commons and category|qid=Q2217963}} | ||
| + | {{clear right}} | ||
| + | :{{tlx|Commons and category}} when placed on [[Chicago Lawn, Chicago]] (neither gallery nor category in wikidata): | ||
| + | {{Commons and category|qid=Q2963317}} | ||
{{clear}} | {{clear}} | ||
Revision as of 14:05, 24 March 2020
| 40px | This is a documentation subpage for Template:Commons and category. It contains usage information, categories and other content that is not part of the original template page. |
| 30px | This template uses Lua: |
Contents
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}}
{{Commons and category}}when placed on Car (gallery and category both in wikidata):
{{Commons and category}}when placed on Beinn an Dòthaidh (only category in wikidata):
{{Commons and category}}when placed on Samuel Baker House (only gallery in wikidata):
{{Commons and category}}when placed on Chicago Lawn, Chicago (neither gallery nor category in wikidata):
See also
- Template:Commons
- Template:Commons-inline - shows Commons gallery inline
- Template:Commons category
- Template:Commons category-inline - shows Commons category inline
- Template:Commons category multi - to list up to 6 categories
- Template:Commons and category-inline - shows Commons gallery and category inline
- Template:Sister project links - to link all Wikinews, Wikisource, etc.
- Template:Wikimedia Commons redirect - specialized soft redirect template for Commons