Module:Sandbox/Cabayi/ListAs

< Module:Sandbox‎ | Cabayi
Revision as of 17:30, 27 March 2018 by imported>Cabayi (t3)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Sandbox/Cabayi/ListAs/doc

local p = {}
local currentTitle = mw.title.getCurrentTitle()

function p.ListAs(frame)
--	basePageTitle
--	txt = currentTitle
--	ns, title, suffix = string.match(txt, "(.*):(.*)/(.*)")
--	result = title
	-- Only process article Talk namespace (#1)
	if to_number(p.getCurrentTitle["namespace"]) ~= 1 then
		return "This only works in an article's talk page, not in ns #" .. p.getCurrentTitle["namespace"] .. "."
	end

	return result
end

return p