You are here

function taxonomy_page_title_pattern_alter in Page Title 6.2

Same name and namespace in other branches
  1. 8.2 modules/taxonomy.page_title.inc \taxonomy_page_title_pattern_alter()
  2. 7.2 modules/taxonomy.page_title.inc \taxonomy_page_title_pattern_alter()

Implementation of hook_page_title_pattern_alter().

File

modules/taxonomy.page_title.inc, line 32
Taxonomy implementations of the page title hooks

Code

function taxonomy_page_title_pattern_alter(&$pattern, &$types) {
  $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
  // Taxonomy Term Page
  if (!strncmp($menu_item['path'], 'taxonomy/term/%', 15) && ($term = taxonomy_get_term($menu_item['map'][2]))) {
    $types['taxonomy'] = $term;
    $pattern = variable_get('page_title_vocab_' . $types['taxonomy']->vid, '');
  }
}