Line 14:
Line 14:
end
end
if map == '' then
if map == '' then
−
local currentEntityId = mw.ext.UnlinkedWikibase.getEntityId('enwiki')
+
return ""
−
if currentEntityId then
−
local entity = mw.wikibase.getEntity(currentEntityId) or {}
−
else
−
local entity = {}
−
end
−
local claims = entity.claims or {}
−
local mapProp = claims.p15
−
if not mapProp then -- no claim of that property
−
return ""
−
end
−
map = mapProp[0].mainsnak.datavalue.value -- This should eventually iterate over all possible values?
end
end
local filecode = "[[File:" .. map .. "|"
local filecode = "[[File:" .. map .. "|"