Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
User role CSS class on body
JohanRonstrom
New
Hi!
I need to target several different elements on each page with CSS depending on the user role of the logged in user.
Is there a way to get that info in the default.master.php in my theme? Or add it to the $this->CssClass ?
I tried searching but everything I found was the comment user role plugin, witch I already use.
Thank you!
/ johan
Tagged:
0
Comments
You may be interested in that plugin http://vanillaforums.org/addon/roletitle-plugin
No, this is the one I already use, and it doesn't relate to what I want.
I want to add the role class(es) of the user you are currently logged in as to the body element.
Oh, sorry, my fault. You get the roles with that code:
If you know where to do that...
...you are done (I personally do not know)
You can add any class you want to anything using jquery .addClass
http://api.jquery.com/addclass/
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌