Add HTML to Page Title for Entity (Profile2) I have a Profile2 page where I want to add some HTML into the page title (I want to insert a fontawesome icon). I am using Display Suite to layout the Profile2 page with a custom view mode. 

I have succeeded in over-writing the title using the function hook_profile2_view_alter() and drupal_set_title(), but drupal_set_title() uses check_plain, which strips out all the extra html. I tried using hook_preprocess_page, but there is no title variable available. I think this is because Display Suite takes over the title variable, and renames it as label. I also tried the html_title module without any luck, as I'm pretty sure this is because it only works on nodes and not on entities. I also tried hook_preprocesss_profile2 (having first used mymodule_preprocess_entity(&amp;$variables, $hook) to create the function suggestion), but this function doesn't seem to be running on the page. I'm not sure if this is because I'm using display suite or a custom view mode. 

Any help much appreciated, as I seem to be running out of options.
I solved this by adding the HTML to a custom page template based on the user role and profile. I used the following code to create the template suggestion in the template.php file:

function MYTHEME_preprocess_page(&amp;$variables) {
  global $user;    
    if(arg(0) == 'profile-carer' &amp;&amp; in_array('my custom role', $user-&gt;roles)) :
      $variables['theme_hook_suggestion'] = 'page__profile_carer_my_custom_role';
    endif;
}


I was then able to use the custom template page--profile-carer-my-custom-role.tpl.php based on the page.tpl.php