Jump to content

Topic on Extension talk:ForceTocOnEveryPage/Flow

How to make exceptions in hooks

3
Cozbaldwin (talkcontribs)

I don't know if anyone will ever see this, but I'd love to know how to exempt specific pages... and NOTOC doesnt work.

I am smart enough to know I would do it in hooks.php but not smart enough to know how to write the code I need... because every attempt I made throws an error and breaks the site.

I just want to make exceptions based on either title of page or the page ID.

Current HOOKS portion of exemptions looks like this:

 if($parser->getTitle()->getNamespace()!=0)
   {return true;}
 if($parser->getTitle()->equals(Title::newMainPage()))
   {return true;}
Cozbaldwin (talkcontribs)

Furthermore... ideally, I'd prefer it as exempting the Page Title and also an array of Page Titles. Thank you!

Cozbaldwin (talkcontribs)

Actually... if anyone ever sees this... after further consideration, it would probably be easiest to just allow NOTOC to override the extension. But any solutions would be grateful. Thanks.

Reply to "How to make exceptions in hooks"