The wiki is currently a work in progress. If you'd like to help out, please check the Community Portal and our getting started guide. Also, check out our sister project on poewiki.net.

Module:Sandbox/Skkias/TestDictionary: Difference between revisions

From Path of Exile 2 Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 3: Line 3:
function p.getEntry(frame)
function p.getEntry(frame)
     local term = frame.args.term or "Unknown"
     local term = frame.args.term or "Unknown"
     local category = frame.args.category or "Town"
     local template = "DictionaryData"
     local pageTitle = "Dictionary:" .. term
     return frame:expandTemplate{ title = template, args = { term = 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
end


return p
return p

Latest revision as of 16:12, 11 December 2024

Module documentation[create] [purge]
local p = {}

function p.getEntry(frame)
    local term = frame.args.term or "Unknown"
    local template = "DictionaryData"
    return frame:expandTemplate{ title = template, args = { term = term } }
end

return p