ഉള്ളടക്കത്തിലേക്ക് പോവുക

ഘടകം:InfoboxSchool

Schoolwiki സംരംഭത്തിൽ നിന്ന്

ഈ ഘടകത്തിന്റെ വിവരണം ഘടകം:InfoboxSchool/വിവരണം എന്ന താളിൽ നിർമ്മിക്കാവുന്നതാണ്

local p = {}

function p.getRevenueDistrict(frame)
    local page = frame.args.page
    if not page or page == '' then
        return ''
    end

    local title = mw.title.new(page)
    if not title then
        return ''
    end

    -- Follow redirect
    if title.isRedirect then
        title = title.redirectTarget
        if not title then
            return ''
        end
    end

    local content = title:getContent()
    if not content then
        return ''
    end

    -- Extract Infobox School block
    local infobox = content:match('{{%s*Infobox School(.-)}}')
    if not infobox then
        return ''
    end

    -- Extract Revenue District
    local district = infobox:match('|%s*റവന്യൂ%s*ജില്ല%s*=%s*([^\n|}]+)')

    if district then
        return mw.text.trim(district)
    end

    return ''
end

return p
"https://schoolwiki.in/index.php?title=ഘടകം:InfoboxSchool&oldid=2938726" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്