Module:GameLanding/Menu

From TwogPedia
< Module:GameLanding
Revision as of 11:35, 29 September 2023 by Couchor (talk | contribs) (Created page with "local p = {} function p.main(frame) local game = mw.text.split(mw.title.getCurrentTitle().text, '/')[1] local menu = mw.html.create('div'):addClass('game__menu') --Menu local menuItems = { {text = 'Overview', link = game}, {text = 'People', link = game .. '/People'}, {text = 'Teams', link = game .. '/Teams'}, {text = 'Tournaments', link = game .. '/Tournaments'}, {text = 'Transfers', link = game .. '/Transfers'}, } for _, item in ipairs(menuItems) do...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

local p = {}

function p.main(frame)
	local game = mw.text.split(mw.title.getCurrentTitle().text, '/')[1]
	
	local menu = mw.html.create('div'):addClass('game__menu')
	
	--Menu
	local menuItems = {
		{text = 'Overview', link = game},
		{text = 'People', link = game .. '/People'},
		{text = 'Teams', link = game .. '/Teams'},
		{text = 'Tournaments', link = game .. '/Tournaments'},
		{text = 'Transfers', link = game .. '/Transfers'},
	}
	for _, item in ipairs(menuItems) do
		menu:node(mw.html.create():wikitext('[[' .. item.link .. '|' .. item.text .. ']]'))
	end
	
	return menu
end

return p