Jump to content

Module:If in category

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by HouseBlaster (talk | contribs) at 03:01, 5 September 2024 (test). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}

function p.main(frame)
	local getArgs = require('Module:Arguments').getArgs
	local args = getArgs(frame)
	return p._main(args)
end

function p._main(args)
	local page
	-- create a title object
	if args.page then
		page = mw.title.new(args.page)
	else
		page = mw.title.getCurrentTitle()
	end
	local category = mw.title.new( args[1], 14 ) -- 14 is Category: namespace args[1]
	return category
end

return p