Difference between revisions of "Template:Label/doc"

From blackwiki
Jump to navigation Jump to search
imported>Pigsonthewing
(not working)
imported>Vanisaac
m (→‎See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{documentation subpage}}
+
{{Documentation subpage}}
{{Lua|Module:Wikibase}}
+
{{Lua|Module:Wd}}
This template gets the label of an item or property, and should stay in sync with the same template as [[d:Template:Label]].
+
This template gets the label of a [[Wikidata]] item or property.
  
Examples:
+
== Usage examples ==
*<code><nowiki>{{label|Q5}}</nowiki></code>: {{label|Q5}}<!--
 
*<code><nowiki>{{label|Q5|en}}</nowiki></code>: {{label|Q5|en}}
 
*<code><nowiki>{{label|Q5|es}}</nowiki></code>: {{label|Q5|es}}-->
 
*<code><nowiki>{{label|P31}}</nowiki></code>: {{label|P31}}
 
  
The language code parameter does not work yet.  It will be optional; if not provided it will default to English.
+
; Standard usage
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}}}</code> → {{{{BASEPAGENAME}} }}
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|Q5}}</code> → {{{{BASEPAGENAME}}|Q5}}
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|P31}}</code> → {{{{BASEPAGENAME}}|P31}}
  
<includeonly>
+
; Leading/trailing white space
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | Q5 }}</code> → {{{{BASEPAGENAME}} | Q5 }}
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | P31 }}</code> → {{{{BASEPAGENAME}} | P31 }}
 +
 
 +
; Lower case
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | q5 }}</code> → {{{{BASEPAGENAME}} | q5 }}
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | p31 }}</code> → {{{{BASEPAGENAME}} | p31 }}
 +
 
 +
== See also ==
 +
* {{tlx|LinkedLabel}}
 +
* {{tlx|Wikidata entity link}}
 +
* {{tlx|Wikidata property link}}
 +
* {{mlx|Wikidata label|getLabel}}
 +
* [[d:Template:Label]]
 +
* [[c:Template:Label]]
 +
 
 +
<includeonly>{{Sandbox other||
 
[[Category:Wikidata templates]]
 
[[Category:Wikidata templates]]
</includeonly>
+
}}</includeonly>

Latest revision as of 23:24, 25 April 2020

This template gets the label of a Wikidata item or property.

Usage examples

Standard usage
{{Label}}Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value).
{{Label|Q5}}Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value).
{{Label|P31}}Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value).
Leading/trailing white space
{{Label | Q5 }}Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value).
{{Label | P31 }}Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value).
Lower case
{{Label | q5 }}Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value).
{{Label | p31 }}Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value).

See also