Module:Param Parse: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(if the "image" parameter has a value but that does not lead to an existing image, then it will still add the page to Category:Needs image)
(when checking if an image doesnt exist, will now not fail if the image link has no SMW data yet)
Line 180: Line 180:
size = '|x'..height..'px'
size = '|x'..height..'px'
end
end
if name and mw.smw.ask('[['..name..']]|?Modification date=data')[1].data==nil then
local imagecheck = name and mw.smw.ask('[['..name..']]|?Modification date=data')
imagecheck = imagecheck~=nil and imagecheck[1]~=nil and imagecheck[1].data~=nil
return '[['..name..size..']][[Category:Needs image]]'
elseif name then
if name and imagecheck then
return '[['..name..size..']]'
return '[['..name..size..']]'
elseif name then
return '[['..name..size..']][[Category:Needs image]]'
end
end
return nil
return nil