Talk:Snippets/Style pages based on categories

About this board

Stefahn (talkcontribs)

Thanks for your snippet. It's very handy.

How can I add the snippet to a wiki page? If I try to do that, I get ReferenceError: jQuery is not defined

I can add the snippet to my Common.js. However the Common.js seems to be loaded only after the CSS files. So there is a short moment where you can see all the elements I want to disable in a certain category. I don't want the user to see these elements.

Thanks, Stefan

Ciencia Al Poder (talkcontribs)

There's no other way to load it before the page is rendered than output the category classes directly by PHP, by implementing an extension or directly a hook in LocalSettings.php

Stefahn (talkcontribs)

Okay, thanks.
I (re)found the extension AddBodyClass which does exactly what I need.

There are no older topics