VOOZH about

URL: https://minecraft.wiki/w/Module:Ifcategory

⇱ Module:Ifcategory – Minecraft Wiki


Module:Ifcategory

From Minecraft Wiki
Jump to navigation Jump to search
Documentation[view] [edit] [history] [purge]Jump to code ↴

Usage

This module implements {{ifcategory}}.

[view] [edit] [history] [purge]The above documentation is transcluded from Module:Ifcategory/doc.
localp={}
---@param frame frame
functionp.main(frame)
localparent=frame:getParent()
ifnotparentthen
error()
end
localargs=parent.args
localtitle=mw.title.new(args.pageorparent:getTitle())
localcategory=args[1]
localyesText=args[2]or""
localnoText=args[3]or""
localnoIfNonexistent=args.noIfNonexistent
ifnottitleornottitle.existsthen
ifnoIfNonexistent~=""then
returnnoText
end
error((args.pageor"Page").." does not exist")
end
localcategories={}
forcatinmw.text.gsplit(category,";")do
categories[cat]=true
end
fori,vinipairs(title.categories)do
ifcategories[v]then
returnyesText
end
end
returnnoText
end
returnp
Retrieved from "https://minecraft.wiki/w/Module:Ifcategory?oldid=3548297"

Navigation menu