You are here

function uc_catalog_page_title_alter in Page Title 7.2

Same name and namespace in other branches
  1. 8.2 modules/uc_catalog.page_title.inc \uc_catalog_page_title_alter()
  2. 6.2 modules/uc_catalog.page_title.inc \uc_catalog_page_title_alter()

Implements hook_page_title_alter().

File

modules/uc_catalog.page_title.inc, line 20
Ubercart Catalog implementations of the page title hooks

Code

function uc_catalog_page_title_alter(&$title) {
  $menu_item = menu_get_item();

  // If we're looking at a UC Catalog term page, get the term title
  if (!strncmp($menu_item['path'], 'catalog', 7) && isset($menu_item['page_arguments'][0]) && ($term = taxonomy_term_load($menu_item['page_arguments'][0])) && variable_get('page_title_vocab_' . $term->vocabulary_machine_name . '_showfield', 0) && ($term_title = page_title_load_title($term->tid, 'term'))) {
    $title = $term_title;
  }
}