Drupal - Window Title vs Page Title
The title set with drupal_set_title()
is both the page title, and the browser window title.
If you are looking for a module that can change tHE window title, you can look at Page Title.
If you want to be able to do it from A CUSTOM module, you can implement hook_preprocess_page(&$variables)
to modify the content of $variables['head_title']
, which contains a modified version of the page title to use in the <title>
tag.
function mymodule_preprocess_page(&$variables) {
$variables['head_title'] = t("The new HTML title.");
}
You may want to checkout the Page Title project http://drupal.org/project/page_title
Allows you to customize the page title on a per content or per node basis.
Some details from the module's project page:
The word "title" is a bit overloaded. Every piece of content in Drupal has a title, and so does every page. The page title is the one found in the HTML head inside the tag. It is also used on SERPs (Search Engine Result Pages) and can greatly enhance your websites SEO (Search Engine Optimization).
This module gives you granular control over the page title. You can specify patterns for how the title should be structured and, on content creation pages, specify the page title separately to the content's title.