function node_page_title_alter in Page Title 8.2
Same name and namespace in other branches
- 6.2 modules/node.page_title.inc \node_page_title_alter()
- 7.2 modules/node.page_title.inc \node_page_title_alter()
Implements hook_page_title_alter().
File
- modules/
node.page_title.inc, line 12 - Node implementations of the page title hooks
Code
function node_page_title_alter(&$title) {
$menu_item = menu_get_item();
// Test if this is a node page.
if (!strncmp($menu_item['path'], 'node/%', 6) && ($node = menu_get_object()) && !empty($node->page_title) && variable_get('page_title_type_' . $node->type . '_showfield', 0)) {
// If the node has a custom page title and the node type is configured
// to have a custom page title (ie, it's not a leftover from a previous
// setting), then use it.
$title = $node->page_title;
}
}