function book_page_alter

Implements hook_page_alter().

Adds the book menu to the list of menus used to build the active trail when viewing a book page.

File

modules/book/book.module, line 908

Code

function book_page_alter(&$page) {
    if (($node = menu_get_object()) && !empty($node->book['bid'])) {
        $active_menus = menu_get_active_menu_names();
        $active_menus[] = $node->book['menu_name'];
        menu_set_active_menu_names($active_menus);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.