Difference between revisions of "Template:ItemLC/doc"
Jump to navigation
Jump to search
imported>RexxS (create doc) |
imported>WOSlinker (lua) |
||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
| + | {{lua|Module:WikidataIB}} | ||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | ||
This template is a wrapper for the function getItemLangCode in [[Module:WikidataIB]] | This template is a wrapper for the function getItemLangCode in [[Module:WikidataIB]] | ||
Latest revision as of 18:00, 14 December 2020
| File:Edit-copy green.svg | This is a documentation subpage for Template:ItemLC. It contains usage information, categories and other content that is not part of the original template page. |
| 30px | This template uses Lua: |
This template is a wrapper for the function getItemLangCode in Module:WikidataIB
It takes one optional unnamed parameter, the qid for a Wikidata entity. If the parameter is omitted, it uses the qid of the Wikidata entity associated with the current page.
- If the item for that qid has property Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P17), it looks at the Wikidata entry for the first preferred value for the country.
- If the country has an Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P37), it looks at the Wikidata entry for the first preferred value for the official language.
- If that official language has a Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P424), it returns the first preferred value of the code.
- Otherwise it returns nothing.
Example
For Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (Q693330) (which is in Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (Q189):
{{ItemLC|Q693330}}→ Lua error in Module:WikidataIB at line 177: attempt to index field 'wikibase' (a nil value).