Goodmorning dear drupal contributers!
I am trying to make a block where the breadcrumb will be displayed. The code I use is the following:
$crumbs = drupal_get_breadcrumb();
$trail = implode(' ', $crumbs);
$trail = "You are here: $trail->";
print $trail;
$title = drupal_set_title();
$nid = arg(1);
$node = node_load($nid);
$some = $node->type;
if ($some == 'news_article' )
{
print "News->";
}else
{
print "Article->";
}
print $title;
Please dont take in consideration the part that I check the node_type. Is irrelevant to what I want to know...
So, I found that $breadcrumb is an array and if I use the drupal_get_breadcrumb function and then an implode, i can get the string that gives me the path. My problem is that I can't find anywhre what exactly this 'breadcrumb array' contains and WHY the last path is not included. To give you a better vision to what i am saying look at the following example:
In my menu I have Menu_Item1 which has a subcategory path1, which also has to subcategories path2 and path3. In path2 I have, lets say, article1. So the breadcrumb should be (after my code is executed):
Home-> Menu_item1->path1->path2->article1
when in return I have:
Home-> Menu_item1->path1->article1.