Jump to content

Module:FlexGallery: Difference between revisions

From Climbopedia
No edit summary
No edit summary
Line 12: Line 12:
             width = tonumber(v)
             width = tonumber(v)
         elseif (k % 2) == 0 then
         elseif (k % 2) == 0 then
             images.insert(tostring(v))
             images.insert(tostring("goodbye"))
         else
         else
             thumbnails.insert(tostring(v))
             thumbnails.insert(tostring("hello"))
         end
         end
     end
     end

Revision as of 20:21, 20 August 2025

Documentation for this module may be created at Module:FlexGallery/doc

local p = {}
local width
local images = {}
local thumbnails = {}

-- frame.args

p.hi = function(frame)
    for k, v in pairs(frame.args) do
        -- v = v:gsub("[\n\r]", "") seems unnecessary..
        if k == 1 then
            width = tonumber(v)
        elseif (k % 2) == 0 then
            images.insert(tostring("goodbye"))
        else
            thumbnails.insert(tostring("hello"))
        end
    end
    return images
end

return p