This page is protected against editing.

Template:Label

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
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
ucfirst: upper case for the first letter
lcfirst: lower case for the first letter
none: to leave it as is
noneoptional
show_idshow IDif set to 1 than item ID will be displayed after the labelnoneoptional
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

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), “ucfirst” (upper case for the first letter), “lcfirst” (lower case for the first letter) or “none” (to leave it as is)

Default
none
Lineoptional
linklink

Link type; “wikipedia”, “wikidata”, “commons” or “-” (see template documentation for details).

Default
wikipedia
Lineoptional
show IDshow_id

if set to 1 than item ID will be displayed after the label

Default
none
Lineoptional

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

Example

See also

Templates linking contents

"1-N" means from one to many.

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