Jump to content

Module:FootballCatParser

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by FastCube (talk | contribs) at 00:41, 25 July 2025 (attempt to add segmented and variant categories). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
local p = {}

function p.parse(frame)
    local args = frame.args
    local rest = args[1] or ""
    local segment, variant = "", ""

    -- Match known segments and variants
    if rest:match("men's") then segment = "men's" end
    if rest:match("women's") then segment = "women's" end
    if rest:match("youth") then segment = "youth" end
    if rest:match("futsal") then variant = "futsal" end
    if rest:match("beach soccer") then variant = "beach soccer" end

    return frame:expandTemplate{
        title = 'Template:YYYY in continent association football category header/inner core',
        args = {
            continentadjective = args.continentadjective,
            continentnoun = args.continentnoun,
            year = args.year,
            segment = segment,
            variant = variant
        }
    }
end

return p