From 9b22de0e579d659e6c3c5db6abad029f7dec1d43 Mon Sep 17 00:00:00 2001 From: Nelson Hart Date: Fri, 14 Jun 2013 13:00:01 -0300 Subject: [PATCH] getting customized menu item to use in breadcrumb --- includes/breadcrumb.inc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/includes/breadcrumb.inc b/includes/breadcrumb.inc index 9c587442..872eb70a 100644 --- a/includes/breadcrumb.inc +++ b/includes/breadcrumb.inc @@ -58,13 +58,17 @@ function islandora_get_breadcrumbs_recursive($pid, FedoraRepository $repository, $root = variable_get('islandora_repository_pid', 'islandora:root'); if ($pid == $root) { $title = 'Islandora Repository'; - $trail = menu_get_active_trail(); - foreach ($trail as $key => $item) { - if ($item['link_path'] == 'islandora') { - $title = $item['link_title']; - break; - } + $mlid = db_select('menu_links', 'ml') + ->condition('ml.link_path', 'islandora') + ->fields('ml', array('mlid')) + ->execute() + ->fetchField(); + + if ($mlid) { + $link = menu_link_load($mlid); + $title = (isset($link['title']) ? $link['title'] : $title); } + return array( l(t('Home'), ''), l($title, 'islandora'),