This page is protected against editing.

Template:Label

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Label/doc.

This template returns the label for a particular entity (item or property).

Usage

{{Label |1= |2= |link= |capitalization= }}

Template parameters

ParameterDescriptionDefaultStatus
1
item
itemQ-code number in form "Q" + item number. Also works with Wikidata properties if you use "P"+number.emptyrequired
2
lang
languageLanguage code (only needs to be provided if the language displayed is to be fixed and independent of the user’s preferences).emptyoptional
linklinklink type:
wikipedia will try to link to Wikipedia (does not work for properties)
wikidata to Wikidata
commons to Commons (does not work for properties)
- means no link.
The code will try first the link of your choice then if not possible it will fallback and try linking to Wikipedia, and if that is not possible than to Wikidata.
wikipediaoptional
capitalizationcapitalizationcan be:
uc: upper case
lc: lower case
tc: title case or upper case for the first letter of each word
ucfirst: upper case for the first letter of the first word
lcfirst: lower case for the first letter of the first word
none: to leave it as is
noneoptional
show_idshow IDset to 1 to display item ID after the label0optional
Template data
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

This template returns the label for a particular entity (item or property).

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
item1 item

Q-code number in form "Q" + item number. Also works with Wikidata properties if you use "P"+number.

Linerequired
language2 lang

Language code (only needs to be provided if the language displayed is to be fixed and independent of the user’s preferences).

Lineoptional
capitalizationcapitalization

Capitalization rule; “uc” (upper case the whole label), “lc” (lower case the whole label), “tc” (title case or upper case for the first letter of each word), “ucfirst” (upper case for the first letter), “lcfirst” (lower case for the first letter) or “none” (to leave it as is)

Suggested values
uc lc tc ucfirst lcfirst none
Default
none
Lineoptional
linklink

Link type (see template documentation for details).

Suggested values
wikipedia wikidata commons -
Default
wikipedia
Lineoptional
show IDshow_id

set to 1 to display item ID after the label

Default
0
Booleanoptional

Additional information

The template is intended to be used in the following namespaces: all namespaces

The template is intended to be used by the following user groups: all users

Relies on:
Module:Wikidata label

See also

Example

  • {{label|Q97|ru|capitalization=none}}: Атлантический океан (label in specified language, tooltip in user's language)
  • {{label|Q97|capitalization=none}}: Atlantic Ocean (label and tooltip in user's language)
  • {{label|Q97|capitalization=uc}}: ATLANTIC OCEAN (label and tooltip in user's language)
  • {{label|Q97|capitalization=lc}}: atlantic ocean (label and tooltip in user's language)
  • {{label|Q97|capitalization=ucfirst}}: Atlantic Ocean (label and tooltip in user's language)
  • {{label|Q97|capitalization=lcfirst}}: atlantic Ocean (label and tooltip in user's language)
  • {{label|Q5|link=wikipedia}}: Atlantic Ocean (label and tooltip in user's language+link to Wikipedia in the user's language)
  • {{label|Q5|link=wikidata}}: Atlantic Ocean
  • {{label|Q5|link=wikidata talk}}: Atlantic Ocean
  • {{label|Q5|link=commons}}: Atlantic Ocean
  • {{label|Q5|link=commonscat}}: Atlantic Ocean
  • {{label|Q5|link=-}}: Atlantic Ocean
  • {{label|P17}}: country
  • {{label|P17|link=-}}: country

Related property

Templates linking contents

"1-N" means from one to many.

Upwards links
Downwards links
Sideways page links
Sideways category links
Interproject links