Module:Sandbox/Skkias/TestDictionary

From Path of Exile 2 Wiki
Revision as of 16:07, 11 December 2024 by Skkias (talk | contribs)
Jump to navigation Jump to search
Module documentation[create] [purge]
local p = {}

function p.getEntry(frame)
    local term = frame.args.term or "Unknown"
    local category = frame.args.category or "Town"
    local pageTitle = "Dictionary:" .. term

    -- Attempt to fetch the page content
    local page = mw.title.new(pageTitle)
    if page and page.exists then
        return mw.content.getCurrentContent(pageTitle)
    else
        return "Entry not found."
    end
end

return p