Lets say that I have a URL as follows: content/departments/dept1/article

Is there a way so that the breadcrumbs are generated by just using this creating
Home >> Content >> Departments >> Dept1

Thanks

Comments

vm’s picture

custom_breadcrumbs.module may be worth investigating.

steven1350’s picture

what exactly does this do?

WorldFallz’s picture

steven1350’s picture

how do I use this to get breadcrumbs from the url?

vm’s picture

it won't be pulling directly form the url but because it integrates with pathauto you can see it up with the paths you need.

testing the module on a test site should answer your questions.

Otherwise you will need a custom module AFAICT

micheleannj’s picture

Here's what I came up with to build breadcumbs from urls -- this helps when you have lots of nodes that indexed in a view or taxonomy page, but not actually associated with a menu item.

Add this to your template.php (check first if your theme already has a breadcrumb function, if so, replace the code in it).
(disclaimer -- this is the first code I've written in years!)

function YOURTHEMENAM_breadcrumb($breadcrumb) {
if (!empty($breadcrumb) ) {
$path = explode('/', $_SERVER['REQUEST_URI']);

//compare breadcrumb to path to see if we have to make up a crumb
if(sizeof($path) > (sizeof($breadcrumb) + 1)){
$i = 1;
$link_path = $path[$i];
while ($i < (sizeof($path) - 1)){
$link_text = str_replace('-',' ', $path[$i]);

//can add more clean-up/special cases here

$breadcrumb[] = l(ucwords($link_text), $link_path);
++$i;
$link_path.='/'.$path[$i];
}
}
}
return implode(' > ', $breadcrumb);
}

Anonymous’s picture

Another (very similar) method is detailed here: http://drupal.org/node/698666