Module:InfoboxPlanet

Revision as of 03:02, 29 December 2025 by Admin (talk | contribs) (Created page with "local p = {} function p.main(frame) local args = frame.args local rows = {} local function row(label, value) if value and value ~= "" then table.insert(rows, string.format("|-\n! %s\n| %s", label, value) ) end end row("Galaxy", args.galaxy) row("Radius", args.radius) row("Location", args.location) row("Stargate", args.stargate) local image = "" if args.image then i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

local p = {}

function p.main(frame)
    local args = frame.args
    local rows = {}

    local function row(label, value)
        if value and value ~= "" then
            table.insert(rows,
                string.format("|-\n! %s\n| %s", label, value)
            )
        end
    end

    row("Galaxy", args.galaxy)
    row("Radius", args.radius)
    row("Location", args.location)
    row("Stargate", args.stargate)

    local image = ""
    if args.image then
        image = string.format(
            "|-\n| colspan=\"2\" class=\"infobox-image\" | [[File:%s|250px]]",
            args.image
        )
    end

    return string.format([[
{| class="infobox"
%s
|-
| colspan="2" class="infobox-title" | %s
%s
|}
]], image, args.name or frame:getTitle(), table.concat(rows, "\n"))
end

return p