Module:RecursiveSelectiveList: Difference between revisions

From Ikwipedia
No edit summary
No edit summary
Line 3: Line 3:


function p.main(frame)
function p.main(frame)
     -- Debugging: Display the raw input from the template
     -- Hardcode a test page
     local args = frame:getParent().args
     local pageName = "Jonathan Reed"
     local pageName = args.pageName or "Main Page"
     local pageContent = mw.title.new(pageName):getContent()
   
 
     -- Display what was captured
     if not pageContent then
    return "Debug: pageName = " .. pageName
        return "Error: The page '" .. pageName .. "' does not exist or has no content."
    end
 
    return pageContent
end
end


return p
return p

Revision as of 07:10, 22 December 2024

Documentation for this module may be created at Module:RecursiveSelectiveList/doc

local p = {}
local mw = require('mw')

function p.main(frame)
    -- Hardcode a test page
    local pageName = "Jonathan Reed"
    local pageContent = mw.title.new(pageName):getContent()

    if not pageContent then
        return "Error: The page '" .. pageName .. "' does not exist or has no content."
    end

    return pageContent
end

return p