0

How do I force certain roles to use exclusively administration theme? These roles are only allowed to add content in administration and there is no problem for that. But some pages, like the user profil page, still use the front office theme and I need them to always use the administration theme. Any good solution for that?

Thanks

2
  • 1
    look for my answer here for a hint. Theme key module can do this for you.
    – AjitS
    Oct 26, 2012 at 11:52
  • thks @indrock, I will check it!
    – Mika A.
    Oct 26, 2012 at 11:59

1 Answer 1

1

You might want to look into the hook_admin_paths function where You can define the pages that should use the administration theme.

For this to work on specific roles just use something like:

function mymodule_admin_paths() {
  global $user;
  if(in_array('administrator', $user->roles)) { 
    //Make the changes for the administrator
  }
}
3
  • rerally interesting!!i am checking this
    – Mika A.
    Oct 26, 2012 at 12:12
  • it's working fine, thks!!
    – Mika A.
    Oct 26, 2012 at 12:29
  • Great - no prob. Oct 26, 2012 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.