Module:Sandbox/Cabayi/ListAs

From English Wikipedia @ Freddythechick
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