Add class to body depending on role of author of user page I need to add a class to the body based on the author of the user profile page. I have two roles on my site: standard and premium. I would like to create a body class to reflect this. So, if I am on a standard member's profile page (regardless of my role) "standard-member" would be added to the body classes. If I am on a premium member's profile page (again, regardless of my role) "premium-member" would be added to the body classes.

Is this something that can be done with the context module?
This can be achieved by using the template_preprocess_html function in the template.php file of your theme.

function yourtheme_preprocess_html(&amp;$vars) {
  if (arg(0) == 'user' &amp;&amp; is_numeric(arg(1))) {
    $user = user_load((int) arg(1));

    if (in_array('standard', $user-&gt;roles)) {
      $vars['classes_array'][] = 'standard-member';
    }

    if (in_array('premium', $user-&gt;roles)) {
      $vars['classes_array'][] = 'premium-member';
    }
  }
}