Template:Commons/doc

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

Lua error in package.lua at line 80: module 'strict' not found.

<templatestyles src="Module:Hatnote/styles.css"></templatestyles>

<templatestyles src="Module:Hatnote/styles.css"></templatestyles>

Lua error in package.lua at line 80: module 'strict' not found. This template is part of Wikipedia's sister projects. This template links an article to a page on Wikimedia Commons. Without any arguments, the template uses Wikidata to automatically link to an available gallery or category (if gallery is not available). With an argument, the template links to the named gallery.

Usage

Script error: No such module "Template link general". —puts link-box with current page's name.
Script error: No such module "Template link general". —puts link-box connecting title pagename.
Script error: No such module "Template link general". —puts link-box showing the title showname.
Script error: No such module "Template link general". —floats link-box to the left side.

To place this template on the page, type {{Commons|pagename}}, where pagename is the name of a page on Wikimedia Commons (defaults to "{{PAGENAME}}", the end-name of a page where used).

  • The optional 2nd parameter gives the displayed link text.
  • The |position= parameter accepts one keyword, left, to float the box to the left instead of to the right.
  • To link to a Category, use the related template Script error: No such module "Template link general"., where catname is the name of the category.

Location

If using a large, graphical template produces odd layout problems, like the excessive white space shown on the right of this screenshot, then switch to a different sister template.

Generally:

N Do not place this template in a section all by itself without floating left.
N Do not place this template in a section containing columns without floating left.
N Do not indent this template with colon (:) or a bullet (*) markup.

Specifically:

  • 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.
  • In disambiguation pages, this template is usually placed at the top of the page.
  • In categories, this template should be grouped with other templates at the beginning of the category introduction. This avoids unnecessary white space as any text is floated around the template boxes.

Defaults

The pagename defaults to wiki-variable "{{PAGENAME}}", which is the end-name of the page where used. For a Template:Txxx, the {{PAGENAME}} would be the end-name "Txxx". For a Category:Catxxx, that page would have {{PAGENAME}} as the end-name "Catxxx".

The default positioning of the link-box is to the right-side.

Examples

Script error: No such module "Template link general".

produces

Script error: No such module "Template link general".

produces

Script error: No such module "Template link general".

produces

Script error: No such module "Template link general".

produces

Script error: No such module "Template link general".

produces

Template data

This is the TemplateData documentation for this template used by VisualEditor and other tools.

See the monthly error report for this template.

TemplateData for Commons/doc

Creates a small box with a link to a related page on Wikimedia Commons.

Template parameters

Parameter Description Type Status
Pagename 1

The page name on Commons. The article's page name is used as a default.

Default
empty
Example
empty
Auto value
empty
String optional
Showname 2

Optional displayed link text.

Default
empty
Example
empty
Auto value
empty
String optional
Position position

Position to display the box: 'left' floats the box to the left rather than the default which is on the right.

Default
empty
Example
empty
Auto value
empty
String optional

Tracking categories

Normal categories

Maintenance categories

See also

<templatestyles src="Col-float/styles.css" />

<templatestyles src="Col-float/styles.css" />