Module:LSEvent: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
-- Get the event name corresponding to the code |
-- Get the event name corresponding to the code |
||
local eventName = events[eventCode] |
local eventName = events[eventCode] |
||
mw.log(eventCode) |
|||
mw.log(eventNAme) |
|||
-- If the event name is found, return a formatted link |
-- If the event name is found, return a formatted link |
Revision as of 21:58, 1 September 2024
Documentation for this module may be created at Module:LSEvent/doc
local p = {}
-- Load the data from Module:LSEvent/data
local events = mw.loadData('Module:LSEvent/data')
function p.main(frame)
-- Retrieve the event code passed in the template
local eventCode = frame.args[1]
-- Get the event name corresponding to the code
local eventName = events[eventCode]
mw.log(eventCode)
mw.log(eventNAme)
-- If the event name is found, return a formatted link
if eventName then
return string.format('[[Last Survivor/Events#%s|%s]]', eventName, eventName)
else
-- If the event code is not found, return a message or empty string
return "Event not found"
end
end
return p