function taxonomy_page_title_alter in Page Title 6.2
Same name and namespace in other branches
- 8.2 modules/taxonomy.page_title.inc \taxonomy_page_title_alter()
- 7.2 modules/taxonomy.page_title.inc \taxonomy_page_title_alter()
Implementation of hook_page_title_alter().
File
- modules/
taxonomy.page_title.inc, line 12 - Taxonomy implementations of the page title hooks
Code
function taxonomy_page_title_alter(&$title) {
$menu_item = menu_get_item();
// NOTE: We user $menu_item['map'] here instead of $menu_item['page_arguments']
// as Views can interrupt the path ad moves the argument value from 0 to 2.
// See issue: http://drupal.org/node/1203768
// If we're looking at a taxonomy term page, get the term title
if (!strncmp($menu_item['path'], 'taxonomy/term/%', 15) && ($term = taxonomy_get_term($menu_item['map'][2])) && variable_get('page_title_vocab_' . $term->vid . '_showfield', 0) && ($term_title = page_title_load_title($term->tid, 'term'))) {
$title = $term_title;
}
}