Template:Commons and category inline/doc
This is a documentation subpage for Template:Commons and category inline. It may contain usage information, categories and other content that is not part of the original template page. |
This template uses Lua: |
Purpose
Sometimes articles have both Commons articles (galleries) and categories about them. This template can be used to generate an inline link to a Commons gallery and a Commons category. It is intended for use in the "External links" section of an article.
Usage
This template takes two optional parameters: the Commons gallery and the category. If either of these is left blank, the template searches for them in wikidata. There are a number of other optional parameters, described below:
Format
{{Commons and category inline|CommonsArticleName|CommonsCategoryName}}
Normal usage
{{Commons and category inline|Ursus maritimus|Ursus maritimus}}
Media related to Ursus maritimus (category) at Wikimedia Commons
{{Commons and category}} when placed on Car article (gallery and category both in wikidata):
Media related to Commons and category inline/doc (category) at Wikimedia Commons
{{Commons and category}} when placed on Beinn an Dòthaidh article (only category in wikidata):
Media related to Commons and category inline/doc (category) at Wikimedia Commons
{{Commons and category}} when placed on Samuel Baker House article (only gallery in wikidata):
Media related to Commons and category inline/doc (category) at Wikimedia Commons
{{Commons and category}} when placed on Chicago Lawn, Chicago article (neither gallery nor category in wikidata):
Media related to Commons and category inline/doc (category) at Wikimedia Commons
Other parameters
- Override link text
{{Commons and category inline|Foobar|Foobar|linktext=Foo}}
Media related to Foobar (category) at Wikimedia Commons
- Full link override
{{Commons and category inline|links=[[commons:Foo|Foo]] and [[commons:Category:Bar|Bar]]}}
Media related to Foo and Bar at Wikimedia Commons
- List format
{{Commons and category inline|list=
* [[commons:Foo|Foo]]
* [[commons:Category:Bar|Bar]]
}}
Related media at Wikimedia Commons:
- Extra text
{{Commons and category inline|Ursus maritimus|extratext= Extra text}} on Ursus maritimus article
Media related to Ursus maritimus (category) at Wikimedia Commons Extra text
See also
- {{Commons}}—shows Commons box
- {{Commons-inline}}—shows Commons gallery inline
- {{Commons category}}—shows Commons category box
- {{Commons category-inline}}—shows Commons category inline
- {{Commons category multi}}—to list up to six categories
- {{Commons and category}}—shows Commons box with both gallery and category
- {{Commons and category inline}}—shows Commons gallery and category inline
- {{Copy to Wikimedia Commons}}
- mw:Manual:Pywikibot/commonscat.py
- {{Wikibooks}} / {{Wikibooks inline}}
- {{Wikinews}} / {{Wikinews inline}}
- {{Wikiquote}} / {{Wikiquote-inline}}
- {{Wikisource}} / {{Wikisource-inline}}
- {{Wikivoyage}} / {{Wikivoyage inline}}
- {{Wiktionary}} / {{Wiktionary-inline}}