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

"ഘടകം:InfoboxSchool" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

Schoolwiki സംരംഭത്തിൽ നിന്ന്
'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 local content = title:getContent() if not content then return '' end -- Match Infobox School and extract "റവന്യൂ ജില്ല" local district = co...' താൾ സൃഷ്ടിച്ചിരിക്കുന്നു
 
No edit summary
 
വരി 10: വരി 10:
     if not title then
     if not title then
         return ''
         return ''
    end
    -- Follow redirect
    if title.isRedirect then
        title = title.redirectTarget
        if not title then
            return ''
        end
     end
     end


വരി 17: വരി 25:
     end
     end


     -- Match Infobox School and extract "റവന്യൂ ജില്ല"
     -- Extract Infobox School block
     local district = content:match('{{%s*Infobox School.-\n.-|%s*റവന്യൂ%s*ജില്ല%s*=%s*([^\n|}]+)')
     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
     if district then
         district = mw.text.trim(district)
         return mw.text.trim(district)
     end
     end


     return district or ''
     return ''
end
end


return p
return p

12:44, 18 ജനുവരി 2026-നു നിലവിലുള്ള രൂപം

ഈ ഘടകത്തിന്റെ വിവരണം ഘടകം: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" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്