Difference between revisions of "Module:BASICPAGENAME"

From Northumberland Climbing
Jump to navigation Jump to search
m (Protected "Module:BASICPAGENAME" ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite)))
m (1 revision imported)
(No difference)

Latest revision as of 06:17, 2 August 2020

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

local i = {}

function i.BASICPAGENAME(frame)
    local basicpagename = frame:getParent().args[1] or '';
    if basicpagename == '' then
        basicpagename = mw.title.getCurrentTitle().subpageText;

    basicpagename = mw.ustring.gsub(basicpagename, '%s%(.*%)', '');
    basicpagename = mw.ustring.gsub(basicpagename, '.*%/', '');

    return basicpagename;

return i;