function nodesymlinks_get_breadcrumbs in NodeSymlinks 6
Generate breadcrumbs for current active menu trail. Return array of breadcrumb links. Partly taken from function menutrails_get_breadcrumbs().
Return value
array
1 call to nodesymlinks_get_breadcrumbs()
- nodesymlinks_page in ./
nodesymlinks.module - Menu callback which loads and displays the content from the node wrapped within the different menu and breadcrumbs. It also sets the robots META tag to prevent duplicate search engine indexing.
File
- ./
nodesymlinks.module, line 140 - Node Symlinks allows creating duplicate menu links with unique id to all nodes. As a result all these duplicates have unique menu trails and breadcrumbs.
Code
function nodesymlinks_get_breadcrumbs() {
$crumbs = array();
if (variable_get('nodesymlinks_crumbs_include_home', 1)) {
$crumbs[] = l(t('Home'), '<front>');
}
$trail = _nodesymlinks_menu_get_active_trail();
$depth = count($trail) - 1;
for ($i = 0; $i < $depth; ++$i) {
$crumbs[] = l($trail[$i]['title'], $trail[$i]['href']);
}
// Add current item as last crumb if display type is set so.
$last_crumb_type = variable_get('nodesymlinks_crumbs_lastcrumb', 'parent');
if ($last_crumb_type == 'current_plain') {
$crumbs[] = $trail[$depth]['title'];
}
elseif ($last_crumb_type == 'current_link') {
$crumbs[] = l($trail[$depth]['title'], $trail[$depth]['href']);
}
return $crumbs;
}