Template:Label/doc

From DiSSCo Modelling Framework
< Template:Label
Revision as of 20:47, 6 January 2022 by Admin (talk | contribs) (1 revision imported: Import of useful Templates and Modules from Wikidata)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Page Module:Message box/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "CSS").

Template:Ombox

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}}: Hello World
  • {{label|Q1|en}}: Hello World
  • {{label|Q1|ar}}: Hello World
  • {{label|Q1|he}}: Hello World
  • {{label|Q1|zh}}: Hello World
  • {{label|Q97|capitalization=none}}: Q97
  • {{label|Q97|capitalization=uc}}: Q97
  • {{label|Q97|capitalization=lc}}: q97
  • {{label|Q97|capitalization=ucfirst}}: Q97
  • {{label|Q97|capitalization=lcfirst}}: q97
  • {{label|Q5|link=wikidata}}: Q97
  • {{label|Q5|link=commons}}: Q97
  • {{label|Q5|link=-}}: Q97
  • {{label|P17}}: P17
  • {{label|P17|link=-}}: P17

Examples 2

Hello World (Q1)
{{Label | Q1 }} → Hello World
{{Label | Q1 | en }} → Hello World
{{Label | Q1 | es }} → Hello World
{{Label | Q1 | ru }} → Hello World
{{Label | Q1 | ja }} → Hello World
modified (P31)
{{Label | P31 }} → modified
{{Label | P31 | en }} → modified
{{Label | P31 | es }} → modified
{{Label | P31 | ru }} → modified
{{Label | P31 | ja }} → modified
P279 (P279)
{{Label | Property:P279 }} → P279
{{Label | Property:P279 | en }} → P279
{{Label | Property:P279 | es }} → P279
{{Label | Property:P279 | ru }} → P279
{{Label | Property:P279 | ja }} → P279

See also