Module:InfoboxPet: Difference between revisions
From Elwiki
No edit summary |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
local infobox = require('Module:InfoboxProto').main(frame, title); | local infobox = require('Module:InfoboxProto').main(frame, title); | ||
infobox:addClass('infobox- | infobox:addClass('infobox-pet'); | ||
local fields = { | |||
{ | |||
id = 'name' | |||
}, | |||
{ | |||
id = 'Starting Form' | |||
}, | |||
{ | |||
id = 'Inventory', | |||
localize = 'Pet Inventory Size' | |||
}, | |||
{ | |||
id = 'Trait' | |||
}, | |||
{ | |||
id = 'Commands', | |||
localize = 'Special Commands' | |||
} | |||
} | |||
addFields(fields); | |||
return tostring(infobox) .. '[[Category: Pets]]'; | return tostring(infobox) .. '[[Category: Pets]]'; |
Latest revision as of 13:32, 8 September 2023
Documentation for this module may be created at Module:InfoboxPet/doc
require('Module:CommonFunctions')
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Main process
function p.main(frame)
local args = getArgs(frame);
if args['Icon'] == nil then
args['Icon'] = frame:preprocess('[[File:Dunno.png|48px]]');
end
local title = args['Icon'] .. ' ' .. args['Name'];
local infobox = require('Module:InfoboxProto').main(frame, title);
infobox:addClass('infobox-pet');
local fields = {
{
id = 'name'
},
{
id = 'Starting Form'
},
{
id = 'Inventory',
localize = 'Pet Inventory Size'
},
{
id = 'Trait'
},
{
id = 'Commands',
localize = 'Special Commands'
}
}
addFields(fields);
return tostring(infobox) .. '[[Category: Pets]]';
end
return p