Is there a way to add the users role to the body wrapper?

Re: Is there a way to add the users role to the body wrapper?

by Danny Wahl -
Number of replies: 4

It would be smarter to setup access to things actually based on the role - rather than hiding it afterwards.

Don't expect students to NOT know how to change display:none to display:block

In reply to Danny Wahl

Re: Is there a way to add the users role to the body wrapper?

by Brian Peat -

Good point. I'm just used to joomla where in some themes (such as those from Rocket Theme) they put certain things in the body-like the menu item name. It's really handy for certain things.

the other really nifty tool is something called Advanced Module Manager which can be used to load modules (similar to blocks) on different pages based on all kinds of crazy criteria. you can literally load stuff for a single user if you want.

Anyway, was just brainstorming today and thought of this as a nifty way to customize things based on role.

thanks!

In reply to Brian Peat

Re: Is there a way to add the users role to the body wrapper?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Brian,

Are you not trying to re-invent a feature which already exists in Moodle: the Roles feature?

Joseph

In reply to Brian Peat

Re: Is there a way to add the users role to the body wrapper?

by Danny Wahl -

Joseph is right you should look into roles and contexts and it will probably do what you're looking for.

In reply to Danny Wahl

Re: Is there a way to add the users role to the body wrapper?

by Brian Peat -

I do know what Roles are, and I'm using them more and more for different blocks. I'm not sure what my original issue was that brought up this post, but I think I wanted to load some custom css based on a role. The only way I can think to do that now would be to stick it in a custom block set to only appear for that role and then hide the block itself with css.