Template:Uses Wikidata: Difference between revisions
m 1 revision imported |
Wrap catting in <includeonly> instead of an ifeq |
||
| Line 2: | Line 2: | ||
| position = {{{position|}}} | | position = {{{position|}}} | ||
| project = data | | project = data | ||
| text = This {{module other|module|template}} uses {{#if:{{{section|}}} | one or more [[Wikidata]] properties; see | | text = This {{module other|module|template}} uses {{#if:{{{section|}}} | one or more [[Wikidata]] properties; see {{Section link||{{{section}}}}} for details. | the [[Wikidata]] propert{{#if:{{{2|}}}|ies|y}}: | ||
{{#invoke:Uses Wikidata|usesProperty}} | {{#invoke:Uses Wikidata|usesProperty}} | ||
}}}}{{#switch:{{SUBPAGENAME}} | }}}}<includeonly>{{#switch:{{SUBPAGENAME}} | ||
|sandbox |testcases |doc= <!--no category--> | |sandbox |testcases |doc= <!--no category--> | ||
|#default= | |#default={{module other |[[Category:Modules using data from Wikidata]] |{{template other |[[Category:Templates using data from Wikidata]]}} }} | ||
}}<!-- | }}</includeonly><noinclude> | ||
{{Documentation}} | |||
--> | <!-- Add categories to the /doc subpage --> | ||
</noinclude> | |||
Revision as of 20:05, 6 October 2023
| This template uses Lua: |
This template may be used in the documentation of another template or module, to indicate that that template or module uses a Wikidata property or properties, where available.
Usage
Standard usage
{{Uses Wikidata|P1|P2|P3...}}
Replace P1, P2, P3, etc. with the actual property numbers – including the "P". As many or as few as necessary may be specified.
Section link
If the documentation has a section describing and listing the Wikidata properties used, then a section link may be specified instead:
{{Uses Wikidata|section=name of section}}
Examples
For a single property (e.g. d:Property:P496):
| Markup | Renders as |
|---|---|
{{Uses Wikidata|P496}}
|
This template uses the Wikidata property:
Lua error in Module:Uses_Wikidata at line 13: attempt to index field 'wikibase' (a nil value). |
For multiple properties:
| Markup | Renders as |
|---|---|
{{Uses Wikidata|P10|P20|P30}}
|
This template uses the Wikidata properties:
Lua error in Module:Uses_Wikidata at line 13: attempt to index field 'wikibase' (a nil value). |
As many properties as needed can be specified:
| Markup | Renders as |
|---|---|
{{Uses Wikidata|1=P10|2=P20|3=P30|4=P40|5=P50|6=P101|7=P222}}
|
This template uses the Wikidata properties:
Lua error in Module:Uses_Wikidata at line 13: attempt to index field 'wikibase' (a nil value). |
If the properties are described in a section of the documentation (e.g. ===Using Wikidata===):
| Markup | Renders as |
|---|---|
{{Uses Wikidata|section=Using Wikidata}}
|
This template uses one or more Wikidata properties; see § Using Wikidata for details. |
Tracking categories
The following categories are populated by this template:
See also
- {{Wikidata property}}
- {{Tracks Wikidata}}