Difference between revisions of "Module:InfoboxImage"

Jump to navigation Jump to search
no edit summary
(Infobox image)
 
 
Line 18: Line 18:
local link = clean(args.link)
local link = clean(args.link)


local options = {
local result
alt = alt,
title = title,
link = link,
class = 'infobox-image',
}


local imageTag = mw.getCurrentFrame():extensionTag('image', '', {
if link then
src = image,
result = string.format('[[File:%s|%s|alt=%s|link=%s', image, size, alt, link)
width = size,
else
alt = alt,
result = string.format('[[File:%s|%s|alt=%s', image, size, alt)
title = title
end
})


-- Fallback if extensionTag fails (older wikis)
if title then
if not imageTag or imageTag == '' then
result = result .. '|' .. title
local out = '[[File:' .. image .. '|' .. size
if alt ~= '' then out = out .. '|alt=' .. alt end
if title then out = out .. '|' .. title end
out = out .. ']]'
return out
end
end


return imageTag
result = result .. ']]'
 
return result
end
end


return p
return p
42

edits

Navigation menu