This Lua module is used on many pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them.
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing.
localmArguments--initialize lazilylocalmHatlist=require('Module:Hatnote list')localmHatnote=require('Module:Hatnote')localyesNo=require('Module:Yesno')localp={}--Implements {{For}} from the frame--uses capitalized "For" to avoid collision with Lua reserved word "for"functionp.For(frame)mArguments=require('Module:Arguments')returnp._For(mArguments.getArgs(frame))end--Implements {{For}} but takes a manual arguments tablefunctionp._For(args)localuse=args[1]if(notuse)thenreturnmHatnote.makeWikitextError('no context parameter provided. Use {{other uses}} for "other uses" hatnotes.','Template:For#Errors',args.category)endlocalpages={}functiontwo(a,b)returna,b,1end--lets us run ipairs from 2fork,vintwo(ipairs(args))dotable.insert(pages,v)endlocaltitle=mw.title.getCurrentTitle()localskipCat=title.isTalkPageortitle.namespace==2--don't categorise talk pages and userspacelocaloddCat=skipCatand''or'[[Category:Hatnote templates using unusual parameters]]'localcategory=yesNo(args.category)returnmHatnote._hatnote(mHatlist.forSeeTableToString({{use=use,pages=pages}}),{selfref=args.selfref})..((use=='other uses')and((category==true)or(category==nil))andoddCator'')endreturnp