Module:See other: Difference between revisions

From Wavu Wiki, the 🌊 wavy Tekken wiki
(Created page with "local p = {} p.main = function(frame) local page = frame:getParent():getTitle().text return p._main(page) end p._main = function(page) local thisGame = "Tekken 8" local otherGame = "Tekken 7" local otherPage = page .. " (Tekken 7)" local sevenSuffixP = " %(Tekken 7%)" if page:match(sevenSuffixP) then thisGame = "Tekken 7" otherGame = "Tekken 8" otherPage = page:gsub(sevenSuffixP, "") end local body = "This page is for " .. thisGame .. ". For " .. otherGa...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:


p.main = function(frame)
p.main = function(frame)
local page = frame:getParent():getTitle().text
local page = frame:getParent().args[1]
if page == nil then
page = frame.args[1]
end
return p._main(page)
return p._main(page)
end
end

Latest revision as of 13:14, 25 January 2024

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

local p = {}

p.main = function(frame)
	local page = frame:getParent().args[1]
	if page == nil then
		page = frame.args[1]
	end
	return p._main(page)
end

p._main = function(page)
	local thisGame = "Tekken 8"
	local otherGame = "Tekken 7"
	local otherPage = page .. " (Tekken 7)"
	local sevenSuffixP = " %(Tekken 7%)"
	if page:match(sevenSuffixP) then
		thisGame = "Tekken 7"
		otherGame = "Tekken 8"
		otherPage = page:gsub(sevenSuffixP, "")
	end
	local body = "This page is for " .. thisGame .. ". For " .. otherGame .. ", see [[" .. otherPage .. "]]."
	return mw.getCurrentFrame():expandTemplate{ title = "Hatnote", args = { body } }
end

return p