Module:Multiblock: Difference between revisions
Appearance
Tag: Undo |
No edit summary |
||
| Line 51: | Line 51: | ||
end | end | ||
-- Render the standard infobox | -- Render the standard infobox | ||
Revision as of 04:16, 1 November 2026
Documentation for this module may be created at Module:Multiblock/doc
local p = {}
local function getArg(args, name)
return args[name] or ""
end
function p.main(frame)
local parent = frame:getParent()
local source = parent.args
local args = {}
-- Basic infobox settings
args.above = getArg(source, "name")
args.subheader = getArg(source, "subheader")
args.autoheaders = "y"
args.abovestyle = "background:#eaecee;font-size:130%;padding:0.3em;"
args.headerstyle = "background:#eaecee;"
-- Images
for i = 1, 2 do
local image = getArg(source, "image" .. (i == 1 and "" or i))
if image ~= "" then
args["image" .. (i == 1 and "" or i)] =
"[[File:" .. image ..
"|frameless|alt=" .. getArg(source, "alt") ..
"|border|upright=1|]]"
end
end
if getArg(source, "image3") ~= "" then
args.image3 = getArg(source, "image3")
end
args.caption = getArg(source, "caption")
args.caption2 = getArg(source, "caption2")
-- Properties
args.header10 = "Properties"
args.label11 = "Maximum Power Storage"
args.data11 = getArg(source, "powerstorage")
for i = 1, 15 do
args["label" .. (11 + i)] =
getArg(source, "custom_property_title" .. i)
args["data" .. (11 + i)] =
getArg(source, "custom_property_value" .. i)
end
-- Render the standard infobox
return frame:expandTemplate{
title = "Infobox",
args = args
}
end
return p