Adding the page title to the breadcrumb

From my handbook page on d.o

This little code snippet will add the present page title to the
breadcrumb. We show you how to use this in steps.

Step 1 : If you do not have a template.php file in
your sites/all/themes/yourtheme/ folder, create one.

Step 2 : Copy and paste this code in the
template.php file.

{syntaxhighlighter brush: php;fontsize: 100; first-line: 1; }function phptemplate_breadcrumb($breadcrumb){
if (!empty($breadcrumb)) {
$breadcrumb[] = drupal_get_title();
return '<div class="breadcrumb">'. implode(' ยป ', $breadcrumb) .'</div>';
}
}{/syntaxhighlighter}Remember to clear the cache or theme registry to let drupal know of this new theme function.

Add new comment