Custom Breadcrumbs for Node Type

Im thedrupalblog fand ich gerade dieses hilfreiche Snippet mit dem man das Breadcrumb Menu je nach Node Type anpassen kann:

<?php
function MYTHEME_preprocess_page(&$variables) {
 if ($variables['node']->type == 'MYNODETYPE') {
 $links = array();
 // creating a link to the home page
 $links[] = l('Home', '<front>');
 // here's how you could add a link to a taxonomy page
 $vid = 2;
 foreach ($variables['node']->taxonomy as $k => $v) {
 if ($v->vid = $vid) {
 $links[] = l($v->name, 'taxonomy/term/' . $v->tid);
 break;
 }
 }
 // yet another link
 $links[] = l('Some Other Link', 'SOMEOTHERLINK');
 // lastly, overwrite the contents of the breadcrumbs variable in the page scope
 $variables['breadcrumb'] = theme('breadcrumb', $links);
 }
}
?>

Possibly related posts (automatically generated)