Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template:Commons category/doc
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} {{High-use|all-pages=yes}} <!-- Categories go where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata]]). --> {{redirect|Template:CC|Creative Commons templates|Category:Creative Commons copyright templates}} {{hatnote|This template is part of [[Wikipedia:Wikimedia sister projects|Wikimedia sister projects]].}} {{tlb|Commons category}} links to a "Category:" name in the [[Wikimedia Commons]] repository that corresponds to the article or category. If the Commons category name is misspelled or missing, the link will still appear "[[Help:Link color|blue]]" even though the link will fail. Check the existence of the category on Commons as well as the spelling of names carefully. That said, {{No ping|Pi bot}} will attempt to fix or remove links to non-existent categories. In articles, this template should be placed at the top of the last section on the page so that it floats to the right of that section. A warning will appear if the Commons link is not on Wikidata. {{tsh|Ccat|Commonscat|Cc}} == Usage == {| style="clear:right" |- | {{tl2|Commons category}} || β || Fetches the Commons sitelink from Wikidata (where available) |- | {{tl2|Commons category|''catname''}} || β || Puts link-box connecting title ''catname'' |- | {{tl2|Commons category|''catname''|''showname''}} || β || Puts link-box showing the title ''showname'' |- | {{tl2|Commons category|''catname''|3=position=left}} || style="vertical-align:top;" | β || Floats link-box to the left side, as option to align box to left-margin |- | {{tl2|Commons category|3=nowrap=yes}} || style="vertical-align:top;" | β || Stops the text of the Commons category from wrapping |- | {{tl2|Commons category|3=lcfirst=yes}} || style="vertical-align:top;" | β || Displays the first letter as lower-case |- | {{tl2|Commons category|3=italic=no}} || style="vertical-align:top;" | β || Turn off italics for displayed text |} The two parameters ''catname'' and ''showname'' (1 & 2) are optional, and are intended for cases where the Commons category name is different from the Wikipedia page name. The first parameter is the name of the corresponding category on the Wikimedia Commons, ''without'' the "<code>Category:</code>" prefix. If this first parameter is used, then the template will display the Commons category name, which may be confusing to readers. This text can be overridden by the second parameter, where the Wikipedia page name would typically be used. {{Commons category|Ursus maritimus|Polar bears}} For example, on the [[Polar bear]] page, {{tlc|Commons category|Ursus maritimus|Polar bears}} produces a link to [[Commons:Category:Ursus maritimus]] displayed as "[[Commons:Category:Ursus maritimus|Polar bears]]". The parameter {{para|position}} accepts one value, {{para|position|left}}, that moves the box to the left side, instead of the default right side. More information may be found at [[Template:Side box]]. == Location == <!-- Red messages in preview mode link to this section. --> {{Commons templates location}} == Resolving discrepancies == This template compares locally-defined values against the interwiki links to Commons stored on Wikidata. The discrepancies are highlighted through the addition of [[#Maintenance categories|maintenance categories]]. Pages can be removed from the tracking categories by correcting the local link; removing misplaced template uses; fixing the sitelinks on Wikidata; or expanding the category system on Commons. Ideally there should be one Commons category link per article, and it should be easy for readers to identify the related content on Commons. Some suggested approaches are: The link is to a more general topic than the article: # Is there a more specific Commons category that could be linked to instead? # If not, could it be created with images connected to the article? # Or if there aren't any images connected to the article on Commons, could the Commons category link be removed? There are links to multiple Commons categories in the article: # Could they be replaced by a single Commons category that has the rest as subcategories? # Do all of the Commons categories still exist? # Are they all necessary, or could they be removed? The Commons category links back to the wrong Wikipedia article: # Can you move the sitelink to the Wikidata item for the article? == Tracking categories == === Normal categories === * {{clc|Commons category link from Wikidata}} * {{clc|Commons category link is on Wikidata}} === Maintenance categories === * {{clc|Commons category link is defined as the pagename}} * {{clc|Commons category link is locally defined}} * {{clc|Commons category link is the pagename}} == TemplateData == {{TemplateData header}} <TemplateData> { "description": "This template creates a small box containing a link to a category on Commons. If no value is provided the Commons category value from Wikidata is used, and if none was provided there then the page name is used.", "params": { "1": { "label": "Category name", "description": "The name of the Commons category this template will link to. If no value is provided the Commons category value from Wikidata is used, and if none was provided there then the page name is used.", "type": "string", "required": false }, "2": { "label": "Displayed text", "description": "The text that the link will display to the user. If no value is provided it will default to category name or page name, in that order.", "type": "string", "required": false }, "position": { "label": "Position", "description": "When set to 'left', the template will be positioned on the left side of the page. Otherwise it will default to the right side.", "type": "string", "required": false }, "nowrap": { "label": "nowrap", "description": "Stops the text of the Commons category from wrapping", "type": "string", "required": false }, "lcfirst": { "label": "lcfirst", "description": "Displays the first letter as lower-case", "type": "string", "required": false } } } </TemplateData> == Redirects == * {{Tl|C cat}} * {{Tl|Category commons}} * {{Tl|Category Commons}} * {{Tl|Cc}} * {{Tl|Ccat}} * {{Tl|Commons cat}} * {{Tl|Commonscat}} * {{Tl|Commonscategory}} * {{Tl|Commonsimages cat}} * {{Tl|Wikimedia commons cat}} == See also == {{Commons templates see also}} <includeonly>{{Sandbox other|| <!-- Categories go below this line, please; interwikis go to Wikidata, thank you! --> [[Category:Interwiki category linking templates]] [[Category:Interwiki link sidebar templates]] [[Category:Wikimedia Commons templates|category]] [[Category:Templates that add a tracking category]] }}</includeonly>
Summary:
Please note that all contributions to Bourbon Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Bourbon Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Asterisk
(
edit
)
Template:Category link with count
(
edit
)
Template:Clc
(
edit
)
Template:Col-float
(
edit
)
Template:Col-float-break
(
edit
)
Template:Col-float-end
(
edit
)
Template:Col-float/styles.css
(
edit
)
Template:Commons category
(
edit
)
Template:Commons templates location
(
edit
)
Template:Commons templates see also
(
edit
)
Template:Documentation subpage
(
edit
)
Template:Hatnote
(
edit
)
Template:High-use
(
edit
)
Template:Mbox
(
edit
)
Template:No ping
(
edit
)
Template:No redirect
(
edit
)
Template:Nowrap
(
edit
)
Template:Para
(
edit
)
Template:Plainlist/styles.css
(
edit
)
Template:Redirect
(
edit
)
Template:Sandbox other
(
edit
)
Template:Section link
(
edit
)
Template:Side box
(
edit
)
Template:Sister project
(
edit
)
Template:Sister project/styles.css
(
edit
)
Template:Str number/trim
(
edit
)
Template:Strong
(
edit
)
Template:TemplateData header
(
edit
)
Template:Template link
(
edit
)
Template:Template link code
(
edit
)
Template:Template link with bold
(
edit
)
Template:Template other
(
edit
)
Template:Template parameter usage
(
edit
)
Template:Template shortcut
(
edit
)
Template:Terminate sentence
(
edit
)
Template:Tl
(
edit
)
Template:Tl2
(
edit
)
Template:Tlb
(
edit
)
Template:Tlc
(
edit
)
Template:Tsh
(
edit
)
Template:Xmark
(
edit
)
Template:Yesno
(
edit
)
Template:Yesno-no
(
edit
)
Module:Arguments
(
edit
)
Module:Check for unknown parameters
(
edit
)
Module:Format link
(
edit
)
Module:Hatnote
(
edit
)
Module:Hatnote/styles.css
(
edit
)
Module:Hatnote list
(
edit
)
Module:High-use
(
edit
)
Module:List
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:No ping
(
edit
)
Module:Redirect
(
edit
)
Module:Redirect hatnote
(
edit
)
Module:Section link
(
edit
)
Module:Shortcut
(
edit
)
Module:Shortcut/config
(
edit
)
Module:Shortcut/styles.css
(
edit
)
Module:Side box
(
edit
)
Module:Side box/styles.css
(
edit
)
Module:String
(
edit
)
Module:TableTools
(
edit
)
Module:Template link general
(
edit
)
Module:Transclusion count
(
edit
)
Module:Transclusion count/data/C
(
edit
)
Module:Yesno
(
edit
)
Toggle limited content width