Monday, May 14, 2012

Tagged under: , , ,

How to set page title in Drupal 7 programmatically


















Sometimes you can not set page titles using formal method, here's how to do it programmatically


In template.php:
vars[‘head_title_array’] contains parts of title (title actually have some parts)
var[‘head_array’] contains assembled title

So, to change the title:
$vars['head_title'] = ‘My title’ . ' | ' . $vars['head_title'];

0 comments:

Post a Comment