This page is protected against editing.

Template:Label

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentation[view·edit·history·purge]
This documentation istranscludedfromTemplate: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:
wikipediawill try to link to Wikipedia (does not work for properties)
wikidatato Wikidata
commonsto Commons (does not work for properties)
-(orno) 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

TemplateDatais 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 byVisualEditorand possibly other tools likeUpload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use{{TemplateBox}}with either‎useTemplateData=1or‎useTemplateData=onlyon the‎/docsubpage 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
item1item

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

Linerequired
language2lang

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
uclctcucfirstlcfirstnone
Default
none
Lineoptional
linklink

Link type (see template documentation for details).

Suggested values
wikipediawikidatacommons-
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)

Templates linking contents

"1-N"means fromone to many.

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