5,478
edits
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 20: | Line 20: | ||
local images = cargo.query('Gallery_Image', | local images = cargo.query('Gallery_Image', | ||
table.concat(fields, ','), query) | table.concat(fields, ','), query) | ||
if #images == 0 then | |||
return '' | |||
end | |||
local wikitext = '==' .. header .. '==\n' | local wikitext = '==' .. header .. '==\n' | ||
Line 26: | Line 30: | ||
wikitext = wikitext .. img.file .. '|' .. img.caption .. '\n' | wikitext = wikitext .. img.file .. '|' .. img.caption .. '\n' | ||
end | end | ||
wikitext = wikitext .. '</gallery>\n' | |||
return frame:preprocess(wikitext) | return frame:preprocess(wikitext) | ||
end | end | ||
return p | return p |