ഘടകം:InfoboxSchool
ദൃശ്യരൂപം
ഈ ഘടകത്തിന്റെ വിവരണം ഘടകം: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