![]() |
VOOZH | about |
This module implements {{ifcategory}}.
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