Page permanently protected

Template:Label: Difference between revisions

From Wikidata
Jump to navigation Jump to search
Content deleted Content added
The Anonymouse (talk | contribs)
Zolo (talk | contribs)
using Module:Wikidata (loading time appears to be divided by around 4)
Line 1: Line 1:
<includeonly>{{#invoke: WBHacks | label | qid={{{1}}} | lang={{#if: {{{2|}}} | {{{2}}} | {{int:Lang}} }} }}</includeonly><noinclude>
<includeonly>{{#invoke: Wikidata | getLabel |entity={{{1|}}}|lang={{{lang|}}}}}</includeonly><noinclude>
{{documentation}}</noinclude>
{{documentation}}</noinclude>

Revision as of 21:22, 24 August 2014

Documentation icon Template documentation[view · edit · history · purge ]

This template returns the label for a particular entity (item or property), using Module:Wikidata label.

Usage

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

Parameters

Parameter name Description Default value required or optional?

parameter #1 (1) Wikidata item ID number in form "Q" + item number.
Also works with Wikidata properties if you use "P"+number.
empty required
parameter #2 (2) Language code (only needs to be provided if the language displayed is to be fixed and independent of the user’s preferences). empty optional
link link type:
wikipedia will try to link to Wikipedia (does not work for properties)
wikidata to Wikidata
wikidata talk to Wikidata talk page
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.
- optional
capitalization can 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
none optional
show_id if set to 1 than item ID will be displayed after the label none optional

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

Examples 1

  • {{label|Q1}}: Universe
  • {{label|Q1|en}}: Universe
  • {{label|Q1|ar}}: Universe
  • {{label|Q1|he}}: Universe
  • {{label|Q1|zh}}: Universe
  • {{label|Q97|capitalization=none}}: Atlantic Ocean
  • {{label|Q97|capitalization=uc}}: Atlantic Ocean
  • {{label|Q97|capitalization=lc}}: Atlantic Ocean
  • {{label|Q97|capitalization=ucfirst}}: Atlantic Ocean
  • {{label|Q97|capitalization=lcfirst}}: Atlantic Ocean
  • {{label|Q5|link=wikidata}}: Atlantic Ocean
  • {{label|Q5|link=commons}}: Atlantic Ocean
  • {{label|Q5|link=-}}: Atlantic Ocean
  • {{label|P17}}: country
  • {{label|P17|link=-}}: country

Examples 2

invalid ID
{{Label | Q1 }} → Universe
{{Label | Q1 | en }} → Universe
{{Label | Q1 | es }} → Universe
{{Label | Q1 | ru }} → Universe
{{Label | Q1 | ja }} → Universe
instance of (P31)
{{Label | P31 }} → instance of
{{Label | P31 | en }} → instance of
{{Label | P31 | es }} → instance of
{{Label | P31 | ru }} → instance of
{{Label | P31 | ja }} → instance of
subclass of (P279)
{{Label | Property:P279 }} → subclass of
{{Label | Property:P279 | en }} → subclass of
{{Label | Property:P279 | es }} → subclass of
{{Label | Property:P279 | ru }} → subclass of
{{Label | Property:P279 | ja }} → subclass of

See also

Template Shorthand Example
{{Autodescription}} {{A}} totality consisting of space, time, matter and energy
{{Data}}
{{EntitySchema}} {{E}}
{{Label}} Douglas Adams
{{LinkedLabel}} Douglas Adams
{{Label and description}} {{LD}} Douglas Adams (English author and humourist (1952–2001))
{{Q}} invalid ID
{{Q+}} invalid ID: English author and humourist (1952–2001)
{{Q'}} Douglas Adams  View with Reasonator View with SQID
{{Q''}} Douglas Adams  View with Reasonator View with SQID
{{Q'''}} Douglas Adams  View with Reasonator View with SQIDView profile on Scholia
{{Q!}} human : any member of Homo sapiens, unique extant species of the genus Homo, from embryo to adultDouglas Adams (Q42)
{{Q*}} human : any member of Homo sapiens, unique extant species of the genus Homo, from embryo to adultDouglas Adams (Q42): English author and humourist (1952–2001)
{{QP}} instance of (P31) of Douglas Adams (Q42)
{{QT}} invalid ID
{{Property}} {{P}}
{{P'}}
{{PT'}}
{{P+}}
{{Lexeme}} {{L}}
{{Claim}} {{C}}
{{Statement}} {{St}}
{{Statement+}}
{{EzStatement+}}
(Label in English) {{Qen}} invalid ID(42)
(Label in French) {{Qfr}} invalid ID(42)
(Label in Italian) {{Qit}} invalid ID(42)
(Label in German) {{Qde}}

invalid ID(42)

(Label in Polish) {{Qpl}}

invalid ID(42)

(Label in Russian) {{Qru}}

invalid ID(42)

(Label in Ukrainian) {{Quk}}

invalid ID(42)

(Label in Spanish) {{Qes}}

invalid ID(42)

(Label in Chinese) {{Qzh}}

invalid ID(42)

(Label in Shahmukhi) {{Qpnb}} invalid ID(42)
(Label in Gurmukhi) {{Qpa}} invalid ID(42)
(Label in Saraiki) {{Qskr}} invalid ID(42)
(Label in Swedish) {{Qsv}} invalid ID(42)