Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:InfoboxNeue/example

From AoM Retold

local p = {}
local infobox = require( 'Module:InfoboxNeue' ):new()

function p.makeComponentsExample()
	local sectionTable = {}

	infobox:renderImage( 'Maintabs Atlantean.webp' )
	infobox:renderIndicator( {
		data = 'Indicator',
		desc = 'Indicator message',
	} )
	infobox:renderHeader( {
		title = 'Title',
		subtitle = 'Subtitle'
	} )

	sectionTable = {
		infobox:renderItem( {
			label = 'Item label',
			data = 'Item data',
		} ),
		infobox:renderItem( {
			label = 'Item label',
			data = 'Item data'
		} ),
		infobox:renderItem( {
			label = 'Item label',
			data = 'Item data'
		} )
	}
	
	infobox:renderSection( {
		content = table.concat( sectionTable ),
		col = 2
	} )

	infobox:renderSection( {
		title = 'Section title',
		content = table.concat( sectionTable ),
		col = 3
	} )

	return infobox:renderInfobox()
end

function p.makeRowSection()
	local sectionTable = {}

	sectionTable = {
		infobox:renderItem( {
			label = 'Bacon',
			data = 'Good',
			row = true,
			spacebetween = true
		} ),
		infobox:renderItem( {
			label = 'Pancetta',
			data = 'Great',
			row = true,
			spacebetween = true
		} ),
		infobox:renderItem( {
			label = 'Prosciutto',
			data = 'Wonderful',
			row = true,
			spacebetween = true
		} )
	}
	
	infobox:renderSection( {
		title = 'Row layout',
		subtitle = 'This is an example of the row layout.',
		content = table.concat( sectionTable )
	} )

	return infobox:renderInfobox()
end

function p.makeListSection()
	local sectionTable = {}

	sectionTable = {
		infobox:renderItem( {
			data = 'Bacon is good',
			desc = 'Bacon ipsum dolor amet burgdoggen boudin spare ribs pork pork chop drumstick beef. Jowl turkey pork, kevin shankle shank shoulder. ',
		} ),
		infobox:renderItem( {
			data = 'Pancetta is great',
			desc = 'Kevin pig fatback, alcatra pancetta sirloin venison tri-tip shankle kielbasa meatloaf spare ribs beef. Corned beef salami kielbasa tenderloin swine spare ribs andouille.',
		} ),
		infobox:renderItem( {
			data = 'Prosciutto is wonderful',
			desc = 'Venison chicken meatloaf, ground round swine short ribs shankle short loin tenderloin jerky capicola. Prosciutto venison sirloin beef brisket pancetta.',
		} )
	}
	
	infobox:renderSection( {
		title = 'List layout',
		subtitle = 'This is an example of the list layout.',
		content = table.concat( sectionTable )
	} )

	return infobox:renderInfobox()
end

function p.makeGridSection()
	local sectionTable = {}

	sectionTable = {
		infobox:renderItem( {
			label = 'Bacon',
			data = 'Good'
		} ),
		infobox:renderItem( {
			label = 'Pancetta',
			data = 'Great'
		} ),
		infobox:renderItem( {
			label = 'Prosciutto',
			data = 'Wonderful'
		} ),
		infobox:renderItem( {
			label = 'Capicola',
			data = 'Delightful'
		} )
	}
	
	infobox:renderSection( {
		title = '2 col grid layout',
		subtitle = 'This is an example of the two column grid layout.',
		content = table.concat( sectionTable ),
		col = 2
	} )
	
	infobox:renderSection( {
		title = '3 col grid layout',
		subtitle = 'This is an example of the three column grid layout.',
		content = table.concat( sectionTable ),
		col = 3
	} )
	
	infobox:renderSection( {
		title = '4 col grid layout',
		subtitle = 'This is an example of the four column grid layout.',
		content = table.concat( sectionTable ),
		col = 4
	} )

	return infobox:renderInfobox()
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies. We only use cookie to make the site function and save your preferences, nothing else.