This page is protected against editing.

Template:Label

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

This template displays the label (name) of a Wikidata entity (item or property) in the requested language, generally with a link for more information.

Usage

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

Template parameters

ParameterDescriptionDefaultStatus
1
item
itemIdentifier of a Wikidata entity, in the form letter + number. The letter is "Q" for items ("Q-items") or "P" for properties. For example, "Q97" for the Atlantic ocean's item.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
linktargetLink destination:
wikipedia will try to link to Wikipedia (does not work for properties)
wikidata to Wikidata
commons to Commons (does not work for properties)
- (or no) means no link.
The template first tries to link to the requested destination, then tries linking to Wikipedia if that is not possible, and if that is also not possible will ultimately fall back 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
<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.


Wikipedia's help about TemplateDataCommons-specific information

This template displays the label (name) of a Wikidata entity (item or property) in the requested language, generally with a link for more information.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
item1 item

[[d:Wikidata:Identifiers|Identifier of a Wikidata entity]], in the form <var>letter</var> + <var>number</var>. The letter is "Q" for items ("Q-items") or "P" for properties. For example, [[wikidata:Q97|"Q97" for the Atlantic ocean's item]].

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
targetlink

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

Examples

Items

Localization:

  • {{label|Q1}}: Universe (label and tooltip in user's language)
  • {{label|Q1|en}}: Universe (label in English, tooltip in user's language)
  • {{label|Q1|ar}}: فضاء كوني (label in Arabic, tooltip in user's language)
  • {{label|Q1|he}}: היקום
  • {{label|Q1|zh}}: 宇宙

Capitalization:

Linking:

  • {{label|Q97|link=wikipedia}}: Atlantic Ocean (label and tooltip in user's language+link to Wikipedia in the user's language)
  • {{label|Q97|link=wikidata}}: Atlantic Ocean (link to Wikidata)
  • {{label|Q97|link=wikidata talk}}: Atlantic Ocean
  • {{label|Q97|link=commons}}: Atlantic Ocean (link to Wikimedia Commons)
  • {{label|Q97|link=commonscat}}: Atlantic Ocean
  • {{label|Q97|link=-}}: Atlantic Ocean (no link)

Properties

  • {{label|P17}}: country
  • {{label|P17|link=-}}: country

Templates linking contents

"1-N" means from one to many.

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