Module:Multi Infobox

From Roat Pkz
Revision as of 03:17, 9 April 2021 by Bosses>Riblet15 (Riblet15 moved Module:Sandbox/User:Riblet15/Multi Infobox to Module:Multi Infobox without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

local p = {}

function p.main(frame)
    local args = frame:getParent().args
    if not args['text1'] then
    	return ''
    end
    
    local cur = args['text1']..'='..args['item1']
    
    local i = 2
    while args['text'..i] do
    	cur = cur..'|-|'..args['text'..i]..'='..args['item'..i]
    	i = i + 1
    end
    
    local res = frame:callParserFunction{ name = '#tag', args = { 'Tabber', cur } }
    
    return '<div class="multi-infobox">'..res..'</div>'
end

return p