Selectively Control or Remove Drupal Book Navigation Links

Selectively Control or Remove Drupal Book Navigation Links

So, the goal is to get rid of the navigation links for Drupal Books (also called table of contents or outline links on actual pages, not to be confused with the content management links for applying the actual hierarchy). It is best to use Drupal's override system. When you edit the original code then you have to be sure to re-apply the change whenever you update Drupal...so...by using a theme override, you can apply this in a way which will still work after you've upgraded your site:

  1. Go into the book module directory drupal/modules/book
  2. Copy the file book-navigation.tpl.php into your theme directory (your theme should be something like sites/all/themes/theme_name/
  3. Edit the new book-navigation.tpl.php and remove the part that says <?php print $tree; ?>
  4. Because of the new theme registry, this change won't be visible immediately, so you must visit example.com/admin/settings/performance and go to the bottom of the page where you click the button for "Clear cached data"