Difference between revisions of "Template:Label"

From RobotX
Jump to navigation Jump to search
Mediawiki>Jeblad
(Created page with "{{#invoke:Wikibase signature|label}}<noinclude> {{documentation}} </noinclude>")
 
Wikimedia Commons>4nn1l2
m (Changed protection level for "Template:Label": downgraded protection level per consensus ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite)))
Line 1: Line 1:
{{#invoke:Wikibase signature|label}}<noinclude>
+
{{#if:{{{item|{{{1|}}} }}}|
{{documentation}}
+
  {{#invoke:Wikidata label|getLabel
</noinclude>
+
    |item={{{item|{{{1|}}} }}}
 +
    |lang={{{lang|{{{2|{{int:lang}} }}} }}}
 +
    |link={{{link|wikipedia}}}
 +
    |capitalization={{{capitalization|none}}}
 +
  }}
 +
}}<noinclude>{{Documentation}}</noinclude>

Revision as of 03:43, 16 July 2019

Template documentation[view] [edit] [history] [purge]

This template gets the label of an item or property, and should stay in sync with the same template as d:Template:Label.

Examples:

  • {{label|Q1}}: Lua error in Module:Wikidata_label at line 69: attempt to index field 'wikibase' (a nil value).
  • {{label|Q1|en}}: Lua error in Module:Wikidata_label at line 69: attempt to index field 'wikibase' (a nil value).
  • {{label|Q1|es}}: Lua error in Module:Wikidata_label at line 69: attempt to index field 'wikibase' (a nil value).
  • {{label|P31}}: Lua error in Module:Wikidata_label at line 69: attempt to index field 'wikibase' (a nil value).

The language code parameter is optional; if not provided it will default to the local language.