function forum_page_title_pattern_alter in Page Title 8.2
Same name and namespace in other branches
- 6.2 modules/forum.page_title.inc \forum_page_title_pattern_alter()
- 7.2 modules/forum.page_title.inc \forum_page_title_pattern_alter()
Implements hook_page_title_pattern_alter().
File
- modules/
forum.page_title.inc, line 28 - Forum implementations of the page title hooks
Code
function forum_page_title_pattern_alter(&$pattern, &$types) {
$menu_item = menu_get_item();
// Forums Page title Patterns
if (!strncmp($menu_item['path'], 'forum/%', 7) && ($forum = menu_get_object('forum_forum', 1))) {
$types['term'] = $forum;
$forum_vid = variable_get('forum_nav_vocabulary', '');
$forum_vocab = taxonomy_vocabulary_load($forum_vid);
$pattern = variable_get('page_title_vocab_' . $forum_vocab->machine_name, '');
$types['vocabulary'] = $forum_vocab;
}
elseif ($menu_item['path'] == 'forum') {
$pattern = variable_get('page_title_forum_root_title', '');
$forum_vid = variable_get('forum_nav_vocabulary', 0);
$types['vocabulary'] = taxonomy_vocabulary_load($forum_vid);
}
}