Module:Sandbox/Tom Morris
< Module:Sandbox
Jump to navigation
Jump to search
Revision as of 14:16, 19 May 2013 by blackwiki>Tom Morris (avoiding nils)
Documentation for this module may be created at Module:Sandbox/Tom Morris/doc
local p = {}
p.spouse = function(frame)
local spouse_input = mw.text.trim(frame.args[1] or "")
if spouse_input == "PARAMETER_NOT_SET" then
-- get from wikidata
local entity = mw.wikibase.getEntity()
local label = mw.wikibase.sitelink("Q" .. entity.claims.p26[0].mainsnak.datavalue.value["numeric-id"])
return "[[" .. label .. "]]"
else
return spouse_input
end
end
return p