66 513
contributi
(Coordinates output fixed) |
(More image properties) |
||
Riga 19: | Riga 19: | ||
function p.DIVImage(frame) | function p.DIVImage(frame) | ||
local ImageFileName | local ImageFileName | ||
local ImageProperties = {"P11", "P37"} | |||
local Item = mw.wikibase.getEntity() | local Item = mw.wikibase.getEntity() | ||
Riga 35: | Riga 36: | ||
-- </gallery> | -- </gallery> | ||
if Item['claims'][ | for _, Property in pairs(ImageProperties) do | ||
if Item['claims'][Property] then | |||
local FileTitle | local FileTitle | ||
local FileCaption | local FileCaption | ||
local FileName = Item['claims'][ | local FileName = Item['claims'][Property][1].mainsnak.datavalue['value'] | ||
File = mw.title.new( FileName, "File" ) | File = mw.title.new( FileName, "File" ) | ||
FileTitle = "File:" .. FileName | FileTitle = "File:" .. FileName | ||
if File.exists then | if File.exists then | ||
Riga 49: | Riga 50: | ||
end | end | ||
Markup = "<div class='separatorebox'>'''Immagine'''</div>" .. "<div class='contenitoreimgbox'>[[" .. FileTitle .. "|alt=" .. FileCaption .. "|" .. FileCaption .. "]]<br /><span style='font-size: smaller;'>" .. FileCaption .. "</span></div>" | Markup = "<div class='separatorebox'>'''Immagine'''</div>" .. "<div class='contenitoreimgbox'>[[" .. FileTitle .. "|alt=" .. FileCaption .. "|" .. FileCaption .. "]]<br /><span style='font-size: smaller;'>" .. FileCaption .. "</span></div>" | ||
else | else | ||
Markup = "" | Markup = "" | ||
end | |||
end | end | ||