Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:Indian Political Party Alliances

From Wikipedia, the free encyclopedia
-- Module:Indian_Political_Party_Alliances
local p = {}

-- Helper function to fetch data
local function getPartyData(party_code)
    local data = mw.loadData('Module:Indian_Political_Party_Alliances/data')
    if data and data[party_code] then
        return data[party_code]
    end
    return nil
end

function p.getNationalAlliance(frame)
    local party_code = frame.args[1] or frame:getParent().args[1]
    local party = getPartyData(party_code)
    return party and party.national_alliance or "Non-Aligned"
end

function p.getStateAlliance(frame)
    local party_code = frame.args[1] or frame:getParent().args[1]
    local party = getPartyData(party_code)
    return party and party.state_alliance or "Independent"
end

function p.getName(frame)
    local party_code = frame.args[1] or frame:getParent().args[1]
    local party = getPartyData(party_code)
    return party and party.name or party_code
end

function p.getColor(frame)
    local party_code = frame.args[1] or frame:getParent().args[1]
    local party = getPartyData(party_code)
    return party and party.color or "#FFFFFF"
end

function p.getShortName(frame)
    local party_code = frame.args[1] or frame:getParent().args[1]
    local party = getPartyData(party_code)
    return party and party.shortname or party_code
end

return p