I was wondering if anyone has been able to setup alternative themes based on role?

I've tried with the following code (in my template.php):

   global $user;
   if (in_array('Author/Staff Writer',$user->roles) or $user->uid=='1') {
      $vars['template_file'] = 'page-admin';
  }

In the code above, I'm determining if an author or administrator is logged in, and if so display the admin theme.
Unfortunately, it only works for admins and not for those logged in as users under the 'Staff Writter' role.

Anyone have any suggestions?

Thanks in advance!
-wOOge

Comments

wOOge’s picture

This is embarrassing -
In my Roles config I had an extra space at the end of the Role name, so the string I was searching for in the template.php actually didn't exist. *sigh* ... at least it's Friday.

Moderators, if you want to delete this entire thread feel free...

--
wOOge | axonz.com

--
wOOge | adrianjean.ca