Module:Sandbox: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "local p = {}; function p.test(frame) local qid = frame.args.qid; return mw.wikibase.getLabel(qid); end return p;")
 
No edit summary
Line 2: Line 2:


function p.test(frame)
function p.test(frame)
local qid = frame.args.qid;
local id = frame.args.id;
return mw.wikibase.getLabel(qid);
local label = mw.wikibase.getLabel(id);
local entity_type = mw.ustring.sub(id, 1, 1)
local link
if entity_type == "Q" then
link = "Item:"..id
elseif entity_type == "P" then
link = "Property:"..id
else
link = "Special:EntityData:"..id
end
return "[["..link.."|"..label.." ".."("..id..")".."]]"
end
end


return p;
return p;

Navigation menu