Module:InfoboxImage: Difference between revisions

111 bytes added ,  19:18, 13 March 2022
add class param from sandbox as per edit request
(Created page with "-- Inputs: -- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link -- page - page to display for multipage ima...")
 
en>WOSlinker
(add class param from sandbox as per edit request)
Line 12: Line 12:
--    suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
--    suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
--    link - page to visit when clicking on image
--    link - page to visit when clicking on image
--    class - HTML classes to add to the image
-- Outputs:
-- Outputs:
--    Formatted image.
--    Formatted image.
Line 190: Line 191:
         local upright = frame.args["upright"] or "";
         local upright = frame.args["upright"] or "";
         local thumbtime = frame.args["thumbtime"] or "";
         local thumbtime = frame.args["thumbtime"] or "";
         local center= frame.args["center"];
         local center = frame.args["center"];
        local class = frame.args["class"];
          
          
         -- remove prefix if exists
         -- remove prefix if exists
Line 256: Line 258:
         if thumbtime ~= "" then
         if thumbtime ~= "" then
             result = result .. "|thumbtime=" .. thumbtime;
             result = result .. "|thumbtime=" .. thumbtime;
        end
        if class ~= nil and class ~= "" then
            result = result .. "|class=" .. class;
         end
         end
         -- if alt value is a keyword then do not use as a description
         -- if alt value is a keyword then do not use as a description
Line 269: Line 274:
         if title ~= "" and title ~= nil then
         if title ~= "" and title ~= nil then
             result = result .. "|" .. title;
             result = result .. "|" .. title;
        elseif alt ~= "" and alt ~= nil then
            result = result .. "|" .. alt;
         end
         end
         result = result .. "]]";
         result = result .. "]]";
Anonymous user