Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently, in Drupal 5x, top-level book page parents have no breadcrumb whatsoever, not even a link to the main or home page. The following code adds a breadcrumb that includes the title of the page as well as a link home.
Find the code in your page.tpl.php file that looks something like this:
<?php if($breadcrumb) { ?>
<div id="breadcrumb">
<div class="wrapper">
<?php print $breadcrumb; ?>
</div>
</div>
<?php } ?>
Replace that code with this:
<?php if($breadcrumb) { ?> //if the node already has a breadcrumb, print the normal one
<div id="breadcrumb">
<div class="wrapper">
<?php print $breadcrumb; ?>
</div>
</div>
<?php }
elseif (!$is_front) { ?> //checks to see if the page is not the front page, and if it isn't, prints the site name as a link to home, a chevron, and then the title of the current page
<div id="breadcrumb">
<div class="wrapper">
<a href="<?php print base_path(); ?>"><?php print $site_name; ?></a> » <?php print $title ?>
</div>
</div>
<?php } ?>