Developers Archive for the 'drupal custom changes' Category

Customizing Breadcrumb in Drupal

Customizing Breadcrumb in Drupal Tuesday, December 19th, 2006

Drupal has auto generated breadcrumb for every
page. Customizing the breadcrumb is need at some point for our purpose

we can get the drupal breadcrumb for a page using
the function
drupal_get_breadcrumb()

and we can add layers to that or reset it

Eg A:

if the default breadcrumb is
user >> edit
and we want to set it to
user >> edit >> options

then code will be

$breadcrumbs = drupal_get_breadcrumb(); /// to get the existing breadcrumb
$breadcrumbs[] = l(t(’options’), ‘path here); /// appending new path to old
drupal_set_breadcrumb($breadcrumbs); //// assigning the new breadcrumb

Eg A:

if the default breadcrumb is
user >> edit
and we want to set it to
user >> users blog

then code will be

$breadcrumbs[] = l(t(’user’), ‘path here);
$breadcrumbs[] = l(t(’users blog’), ‘path here);
drupal_set_breadcrumb($breadcrumbs);


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.