Edge Rewrite
// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a25617e41e60b36e

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