You are here

function forum_page_title_alter in Page Title 8.2

Same name and namespace in other branches
  1. 6.2 modules/forum.page_title.inc \forum_page_title_alter()
  2. 7.2 modules/forum.page_title.inc \forum_page_title_alter()

Implements hook_page_title_alter().

File

modules/forum.page_title.inc, line 12
Forum implementations of the page title hooks

Code

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

  // Check we're on a forum page and if there is a number to confirm it's a
  // container or forum (rather than root).
  if (!strncmp($menu_item['path'], 'forum/%', 7) && ($term = menu_get_object('taxonomy_term')) && variable_get('page_title_vocab_' . $term->vocabulary_machine_name . '_showfield', 0) && ($forum_title = page_title_load_title($term->tid, 'term'))) {
    $title = $forum_title;
  }
}