Thread:Project:Support desk/Article names only numbers with length of 8 or 13/reply

Hi!

You can definitely do that with a hook. You need a hook, which is executed when a page is about to be created. Manual:Hooks/PageContentSave is executed on every save (not only on new article creations), but I think it comes at least close to that. In this hook you have the information on the article in $wikiPage. Use this WikiPage object to check the page name and if it fits your pattern (see International_Article_Number_(EAN)#Payload:_GTIN-13_number for the calculation process), then continue processing, otherwise abort it.

You might want to implement further conditions like "only use these limitations for pages in the main namespace" (so that e.g. user pages can still be created). However, that would still be a problem for all other pages in the main namespace then - maybe you want to put your EAN articles into their own namespace?! Or "also allow minus signs in the pagename" (or maybe you want to automatically remove them if present?) and so on...