FANDOM


--<nowiki>
--| Returns variables from on the mediawiki title library (see http://dev.wikia.com/wiki/Lua_templating/Reference_manual/Scribunto_libraries), some of which may not be accessible using built-in magic words. 
--|Usage : {{#invoke:magicwords|main|<magicword>}}
--|Example:{{#invoke:magicwords|main|isRedirect}}
local p = {}
--% Retrieves a variable aka Magic word from the title library
--@ frame (table) A scribunto frame
--: (string) a variable aka Magic word from the title library
function p.main(frame)
    local args = require("Dev:Arguments").getArgs(frame)
    local variables = args[1]
    local currTitle = mw.title.getCurrentTitle()
 
    if (variables) and type(currTitle[variables]) ~="function" 
        and type(currTitle[variables]) ~="table" then
 
        return currTitle[variables]
    end
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.