Created
March 14, 2011 22:31
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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