Module:RecursiveSelectiveList
Documentation for this module may be created at Module:RecursiveSelectiveList/doc
local p = {}
local mw = require('mw')
function p.main(frame)
-- Retrieve parameters from the template invocation
local args = frame:getParent().args
local pageName = args["pageName"] -- Explicitly fetch the 'pageName' argument
-- Check if 'pageName' is provided
if not pageName or pageName == "" then
return "Error: 'pageName' parameter is missing or empty."
end
-- Fetch content for the specified page
local pageContent = mw.title.new(pageName):getContent()
-- Handle cases where the page doesn't exist or has no content
if not pageContent then
return "Error: The page '" .. pageName .. "' does not exist or has no content."
end
return pageContent
end
return p