Module:Mod
From PC Gaming Shelter
Documentation for this module may be created at Module:Mod/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 mod type'] = {'Has mod type' },
['Has developer'] = {'Has developer', ',' },
['Has release date'] = {'Has release date' },
['Has status'] = {'Has status' },
['Has note'] = {'Has note' }
}
return propMap
end
local function infoboxSectionPlan()
local sectionMap = {
['Cover image'] = {
heading = '',
template = 'Infobox/Cover',
order = '1',
rows = {
'Image'
}
},
['Mod Info'] = {
heading = 'Mod Info',
template = 'Infobox/Mod Info',
order = '2',
rows = {
'Related game',
'Has mod type',
'Has developer',
'Has release date',
'Has status',
'Has note'
}
},
['Download'] = {
heading = '<i class="fas fa-play"></i> Play!',
template = 'Infobox/Download',
order = '3',
rows = {
'Download links'
}
}
}
return sectionMap
end
function p.infobox(frame)
local category = 'Mods'
local properties = propertiesPlan()
local sections = infoboxSectionPlan()
local footer = ''
local infobox = utils.createInfobox(frame, category, properties, sections, footer)
return infobox
end
return p
