Drupal - Change title head of the pages in Drupal 7 by path

It sounds for your limited set of pages maybe implement THEME_preprocess_html() and examine the url path and override $vars['head_title']. See this blog post as an example: How to set custom page title in Drupal 7

If you have some patterns for the head title try Page Title


Here is how I did it in Drupal 7.

In template.php:

function YOUR_THEME_preprocess_page(&$vars){
  $path = $_GET['q'];

  if (strpos($path,'YOUR_PATH_STRING') !== false) {
    drupal_set_title('YOUR_TITLE');
  }
}

For example, if your path was yoursite.com/boogabooga, then you would set 'YOUR_PATH_STRING' to 'boogabooga' and 'YOUR_TITLE' to whatever you want the page title to be.

Tags:

7