Module:Infobox
Documentation for this module may be created at Module:Infobox/doc
-- Module:Infobox
local p = {}
function p.infobox(frame)
local args = frame:getParent().args
local html = mw.html.create('table'):addClass('infobox')
-- Title
if args.title then
html:tag('tr')
:tag('th')
:addClass('infobox-title')
:wikitext(args.title)
end
-- Image
if args.image then
html:tag('tr')
:tag('td')
:addClass('infobox-image')
:wikitext('[[File:' .. args.image .. '|200px]]')
end
-- Rows
if args.rows then
html:wikitext(args.rows)
end
-- Footer
if args.footer then
html:tag('tr')
:tag('td')
:addClass('infobox-footer')
:wikitext(args.footer)
end
return tostring(html)
end
return p