Module:Main page link

From Team Fortress Wiki
Revision as of 21:11, 17 May 2024 by Tark (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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