Drupal 7 -- Would like to use unique profile template per role I'm working on a Drupal project where we have two main roles (students/teachers) + an admin role. I would like to have entirely different profile pages for the different roles. 

At the moment I think the most maintainable method for doing this is going to be to have several profile template files that are called when the specific role is being viewed; I'm just not sure how to preprocess the profile to hint at the correct template. 

At the moment, I've built some page pre-processing code to check the role of the profile page we're looking at as follows:

function MYTHEME_preprocess_page(&amp;$vars, $hook) {

  // See if we can influence profile pages
  $content = $vars['page']['content'];
  $theme = $content['system_main']['#theme'];

  if($theme == 'user_profile') {
    $roles = $content['system_main']['#account']-&gt;roles;

    if(in_array('teacher', $roles)) {
      $vars['theme_hook_suggestions'][] = 'teacher__user-profile.tpl.php';
    }
    elseif(in_array('student', $roles)) {
      $vars['theme_hook_suggestions'][] = 'student__user-profile.tpl.php';
    }

  }

}


The conditional correctly identifies the profiles being for teachers or students but I can't seem to influence it by suggesting a profile template.  

Any thoughts?

Thanks,
Andrew
Have a look at ThemeKey.
From the project page (emphasis added):

ThemeKey allows you to define simple or sophisticated theme-switching rules which allow automatic selection of a theme depending on current path, taxonomy terms, language, node-type, and many, many other properties. It can also be easily extended to support additional properties exposed by other modules. In combination with Drupal's theme inheritance you can easily achieve features like:

individually-styled channels
a front-page / &quot;splash&quot; screen
a date/time-selected Christmas theme
mobile themes for different auto-detected mobile devices
special themes for &quot;limited&quot; or &quot;old&quot; browsers
content, user, or role -specific themes
indicating your environment (production, staging, testing, sandbox, … )
testing your redesign safely on a live server