function node_page_title_pattern_alter in Page Title 6.2
Same name and namespace in other branches
- 8.2 modules/node.page_title.inc \node_page_title_pattern_alter()
- 7.2 modules/node.page_title.inc \node_page_title_pattern_alter()
Implementation of hook_page_title_pattern_alter().
File
- modules/
node.page_title.inc, line 31 - Node implementations of the page title hooks
Code
function node_page_title_pattern_alter(&$pattern, &$types) {
$menu_item = menu_get_item();
// Test if this is a node page.
if (!strncmp($menu_item['path'], 'node/%', 6) && ($node = menu_get_object())) {
$types['node'] = $node;
// If the node has any taxonomy, grab the first term for user in tokens.
// TODO: Handle multiple terms? Only pass specific terms per content type?
if (!empty($types['node']->taxonomy)) {
reset($types['node']->taxonomy);
$types['taxonomy'] = current($types['node']->taxonomy);
}
$pattern = variable_get('page_title_type_' . $node->type, '');
}
}