Drupal breadcrumb override


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /**
  2.  * Make breadcrumbs include the current page as an inactive crumb
  3.  * Also, remove the top level for image_galleries.
  4.  */
  5. function phptemplate_breadcrumb($breadcrumb) {
  6. if (!empty($breadcrumb)) {
  7. $breadcrumb_new = array();
  8. // Create new breadcrumb array without the top level image gallery link
  9. foreach ($breadcrumb as $crumb) {
  10. if (strstr($crumb, '<a href="/image">') != TRUE) {
  11. $breadcrumb_new[] = $crumb;
  12. }
  13. }
  14. $breadcrumb_new[] = '<span class="active">'. drupal_get_title() .'</span>';
  15. return '<div class="breadcrumb">'. implode(' » ', $breadcrumb_new) .'</div>';
  16. }
  17. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.