Module:Sandbox/Was a bee/getLinkedName/doc
This is the documentation page for Module:Sandbox/Was a bee/getLinkedName
Retrieving text from Wikidata and formatting it in wiki-linked style. Algorithm of this module is as follows.
- Case 1. If there is sitelink, then use sitelink.
- Case 2 If sitelink has disambiguation brackets, then remove the brackets.
- Case 3. If there is no sitelink, then use label.
- Case 4. If there is no sitelink and label, then use item ID (with editing pencil like this "File:Blue pencil.svg").
- Case 3. If there is no sitelink, then use label.
- Case 2 If sitelink has disambiguation brackets, then remove the brackets.
UsageEdit
{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|QID}}
ExamplesEdit
Case 1: Sitelink existsEdit
- Input
{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|Q42}}
- Output
Case 2: Sitelink exists but which has disambiguation bracketsEdit
- Input
{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|Q6258348}}
- Output
Case 3: Sitelink doesn't exist but label existsEdit
- Input
{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|Q23366230}}
- Output
Lua error in Module:Sandbox/Was_a_bee/getLinkedName at line 33: attempt to index local 'entity' (a nil value).
Case 4: Both sitelink and label doesn't existEdit
- Input
{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|Q11485627}}
- Output
ParametersEdit
aliasEdit
|alias=
parameter specifies text shown as alias without changing the link target.
- Input
{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|Q30}}
{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|Q30|alias=US}}
- Output