Modul:Infobox

Aus UnderMine Wiki
Zur Navigation springen Zur Suche springen

Die Dokumentation für dieses Modul kann unter Modul:Infobox/Doku erstellt werden

local p = {}
function p.infobox( f )
	local args = f.args
	local titleObject = mw.title.getCurrentTitle()
	local title = args.title or titleObject.rootText

	local image = ''
	if args.image and args.image ~= 'none' then
		image = '<div class="infobox-image">[[File:' .. args.image .. ']]</div>'
	end
	if args.image2 and args.image2 ~= '' then
		image = image .. '<div class="infobox-image">[[File:' .. args.image2 .. ']]</div>'
	end

	local footer = args.footer
	if footer then
		footer = '| class="infobox-footer" colspan="2" | ' .. footer
	end

	local html = {
		'<div class="infobox infobox-' .. args.template .. '">',
			'<div class="infobox-title">' .. title .. '</div>',
			image,
			'{| class="infobox-rows" cellspacing="1" cellpadding="4"',
			'|-',
			args.rows or '',
			footer or '',
			'|}',
		'</div>'
	}
	
	return table.concat( html, '\n' )
end

return p