Skip to content

Instantly share code, notes, and snippets.

@smithmilner
Created March 14, 2011 22:31
Show Gist options
  • Select an option

  • Save smithmilner/870016 to your computer and use it in GitHub Desktop.

Select an option

Save smithmilner/870016 to your computer and use it in GitHub Desktop.
Put this function in your theme's template.php and rename it accordingly. Also set your title as the return of this function in preprocess_page ie: function mytheme_preprocess_page($vars) { $vars['title'] = mytheme_page_title(); } It operates lik
/**
* Set the title of the current page, for display on the page and in the title bar.
* Title is removable if you pass <none> as a variable.
*
* @param $title
* Optional string value to assign to the page title; or if set to NULL
* (default), leaves the current title unchanged.
*
* @return
* The updated title of the current page.
*/
function mytheme_page_title($title = NULL) {
static $none = 0;
if ($title == '<none>') {
$none = 1;
}
if (!$none) {
return drupal_set_title($title);
}else {
return NULL;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment