Module:Infobox Base: Difference between revisions
Appearance
Adds formatting to image |
Only format if not empty |
||
| Line 8: | Line 8: | ||
local base_args = { | local base_args = { | ||
{'t', args.basename}, | {'t', args.basename}, | ||
{'i', string.format('[[File:%s|300px]]', args.image)}, | {'i', args.image and args.image ~= '' and string.format('[[File:%s|300px]]', args.image) or ''}, | ||
{'s', 'General Info'}, | {'s', 'General Info'}, | ||
{'f', 'Base Name', args.basename}, | {'f', 'Base Name', args.basename}, | ||
Revision as of 11:00, 24 June 2025
Documentation for this module may be created at Module:Infobox Base/doc
local p = {}
local infobox = require("Module:Infobox")
function p.infobox(frame)
local args = frame:getParent().args
local base_args = {
{'t', args.basename},
{'i', args.image and args.image ~= '' and string.format('[[File:%s|300px]]', args.image) or ''},
{'s', 'General Info'},
{'f', 'Base Name', args.basename},
{'f', 'Owner', args.owner},
{'f', 'Base Type', args.basetype},
{'f', 'Season', args.season},
{'s', 'Location'},
{'f', 'Biome / Area', args.location},
{'f', 'Coordinates', args.coordinates},
{'s', 'Timeline'},
{'f', 'Date Established', args.dateestablished},
{'f', 'Date Abandoned', args.dateabandoned},
{'s', 'People'},
{'f', 'Members', args.members},
{'s', 'Features'},
{'f', 'Notable Features', args.notablefeatures},
{'f', 'Description', args.description},
}
return infobox.infobox {
getParent = function() return { args = base_args } end
}
end
return p