Difference between revisions of "Module:Main page link"

From Team Fortress Wiki
Jump to: navigation, search
(Created page with "local p = {} function p.check(f) local pageTitle = tostring(mw.title.getCurrentTitle()) local if_lang = f:expandTemplate{title='If lang'} -- Same way we handle t...")
 
m (Protected "Module:Main page link": Main page link ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(No difference)

Latest revision as of 16:08, 15 August 2024

This module is used in the sidebar to direct users to the "correct" version of the main page. Works similarly to the CSS logo switcher.


local p = {}

function p.check(f)
    local pageTitle = tostring(mw.title.getCurrentTitle())
    local if_lang = f:expandTemplate{title='If lang'}

    -- Same way we handle the CSS logo
    if pageTitle:find(" %(Classic%)") then
        return "Main Page (Classic)" .. if_lang
    else
        return "Main Page" .. if_lang
    end
end

return p