Module:Main page link

From Team Fortress Wiki
Revision as of 16:08, 15 August 2024 by Tark (talk | contribs) (Protected "Module:Main page link": Main page link ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(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