Adding the page title to the breadcrumb

By: Arshad

25 Mar 2010

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.

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

No Responses yet to Adding the page title to the breadcrumb

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

About Me

Arshad Chummun Hello I'm Arshad. I'm a 21 years old Drupal Web Developer. This is a site i put up for some reasons i can't remember and this is where i write stuffs i need to remember.;)

In the Web world, i head the Drupal Mauritius User Group and the jQuery user Group Mauritius and i'm a campus representative for Mozilla Firefox. 

DrupalCon CPH 2010

Copenhagen August 23 -27

Drupalcon CPH 2010