PC Gaming Shelter
An archive dedicated to preserving PC Gaming history and more

Module:Community: Difference between revisions

From PC Gaming Shelter
Created page with "local utils = require( 'Module:Utils' ) local p = {} local function propertiesPlan() -- ['Form field name'] = { 'Semantic property', 'delimiter' } local propMap = { ['Image'] = {'Image', 'file' }, ['Related game'] = {'Related game' }, ['Has status'] = {'Has status' }, ['Has note'] = {'Has note' } } return propMap end local function infoboxSectionPlan() local sectionMap = { ['Cover image'] = { heading = '',..."
 
m Text replacement - "Has note" to "Has short description"
 
(One intermediate revision by the same user not shown)
Line 9: Line 9:
['Related game']        = {'Related game' },
['Related game']        = {'Related game' },
['Has status']          = {'Has status' },
['Has status']          = {'Has status' },
['Has note']            = {'Has note' }
['Has short description']            = {'Has short description' }
}
}
return propMap
return propMap
Line 31: Line 31:
'Related game',
'Related game',
'Has status',
'Has status',
'Has note'
'Has short description'
}
}
},
},
['Community links'] = {
['Community links'] = {
heading = 'Join',
heading = 'Join',
template = 'Infobox/Community',
template = 'Infobox/Community links',
order = '3',
order = '3',
rows = {
rows = {

Latest revision as of 16:41, 25 March 2026

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

local utils = require( 'Module:Utils' )

local p = {}

local function propertiesPlan()
	-- ['Form field name'] = { 'Semantic property', 'delimiter' }
	local propMap = {
		['Image']               = {'Image', 'file' },
		['Related game']        = {'Related game' },
		['Has status']          = {'Has status' },
		['Has short description']            = {'Has short description' }
	}
	return propMap
end

local function infoboxSectionPlan()
	local sectionMap = {
		['Cover image'] = {
			heading = '',
			template = 'Infobox/Cover',
			order = '1',
			rows = {
				'Image'
			}
		},
		['Clan Info'] = {
			heading = 'Community Info',
			template = 'Infobox/Community Info',
			order = '2',
			rows = {
				'Related game',
				'Has status',
				'Has short description'
			}
		},
		['Community links'] = {
			heading = 'Join',
			template = 'Infobox/Community links',
			order = '3',
			rows = {
				'Community links'
			}
		}
	}
	return sectionMap
end

function p.infobox(frame)
	local category   = 'Communities'
	local properties = propertiesPlan()
	local sections   = infoboxSectionPlan()
	local footer     = 'Community footer'
	local infobox    = utils.createInfobox(frame, category, properties, sections, footer)
	return infobox
end

return p