Last 5 Pages Viewed: Module:Sidebar/doc / Module:Unsubst/doc / Module:Message box/doc / Module:Navbox/doc / Module:Main page

Module:Main page

From MoHA Wiki

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

local p = {}

function p.banner(frame)

local params  = frame.args
local id      = params['id'] or 'banner'
local class   = params['class'] or 'banner'
local image   = params['image'] or ''
local height  = params['height'] or 'auto'
local bgcolor = params['background-color'] or '#fff'

if image ~= '' then 
	image = frame:preprocess('{{filepath:' .. image .. '}}')
end

local html = mw.html.create()

html:tag('div')
    :addClass(class)
    :attr({
    	['data-bg'] = image, 
    	['id'] = id
    })
    :css({
    	['background-color'] = bgcolor,
    	['height'] = height
    })

return html

end

return p