Module:Infobox/Localdata
Appearance
Documentation for this module may be created at Module:Infobox/Localdata/doc
local localdata = {}
local wikidata = require('Module:Wikidata')
local frame = mw.getCurrentFrame()
local modulename = frame.args.nom
local parent = frame:getParent() or frame
local templatename = parent:getTitle() -- au cas où il soit différent du nom du module
local params = parent.args
-- fill-up global variable localdata using params
for i, j in pairs(params) do
if j and mw.text.trim(j) ~= '' then -- empty parameters are ignored
localdata[i] = j
end
end
localdata.templatename = templatename
localdata.modulename = modulename
-- load wikidata item:
localdata.item = wikidata.getEntity(localdata.wikidata)
return localdata