Anonimo

Modulo:DTGenerico: differenze tra le versioni

Da Wikitrek.
More image properties
(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']['P37'] then
for _, Property in pairs(ImageProperties) do
if Item['claims'][Property] then
local FileTitle
local FileTitle
local FileCaption
local FileCaption
local FileName = Item['claims']['P37'][1].mainsnak.datavalue['value']
local FileName = Item['claims'][Property][1].mainsnak.datavalue['value']
File = mw.title.new( FileName, "File" )
File = mw.title.new( FileName, "File" )
--local FileTitle = "File:" .. Item['claims']['P37'][1].mainsnak.datavalue['value']
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'>[[File:" .. Item['claims']['P37'][1].mainsnak.datavalue['value'] .. "|100%]]</div>"
--Markup = "<div class='separatorebox'>'''Immagine'''</div>" ..  "<div class='contenitoreimgbox'>[[" .. FileTitle .. "|alt={{" .. FileTitle .. "}}|{{" .. FileTitle .. "}}" .. "]]</div>"
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