Module:Sandbox/Tom Morris
< Module:Sandbox
Jump to navigation
Jump to search
Revision as of 13:28, 19 May 2013 by blackwiki>Tom Morris (i'm an idiot - zero-indexed is for other languages!)
Documentation for this module may be created at Module:Sandbox/Tom Morris/doc
local p = {}
p.spouse = function(frame)
if not frame.args[1] == nil then
if not frame.args[2] == nil then
return "[[" + frame.args[1] + "|" + frame.args[2] + "]]"
else
return "[[" + frame.args[1] + "]]"
end
else
local entity = mw.wikibase.getEntity()
if not entity.claims.p26 == nil then
local label = mw.wikibase.label( "Q" .. entity.claims.p26[1].mainsnak.datavalue.value["numeric-id"])
return "[[" + label + "]]"
end
end
end
return p