2

I have created a content type for uploading user details. I have changed the title as UPLOAD PAGE using drupal_set_title. I have installed Meta Tag module, now page title remains same but title tag i.e. (title displayed in browser tab) are different. Please guide me. Thanks

2

Try theme_preprocess_html and modify the title using variable header_title

Sample code:

function mytheme_preprocess_html(&$vars) {
  $vars['head_title'] = 'TITLE';
}

It works for me.

0

Thanks @Vamsi - $vars['head_title'] did the trick for me after lots of frustrating experiences trying different module/UI and code based methods. Here's how I ended up using this to override a particular view one page at a time:

function mytheme_preprocess_html(&$vars) {

  // customize <title> tag for a complex view with url structure /people/%
  if (arg(0)=='people'):
    switch (arg(1)) {
      case 'faculty':
        $vars['head_title'] = 'People - Faculty - My School';
        break;
      case 'graduate-students':
        $vars['head_title'] = 'People - Graduate Students - My School';
        break;
      case 'alumni':
        $vars['head_title'] = 'People - Alumni - My School';
        break;
    }
  endif;

}

Your Answer

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