How can I print a node breadcrumbs into a node.tpl.php?

When I insert print $breadcrumb; into a node.tpl.php template it only displays "array"

Comments

keith.smith’s picture

A list of the variables available in node.tpl.php is available here.

$breadcrumb is available in page.tpl.php as outlined here.

This is a handbook page detailing how to make additional variables available to your templates. While it probably doesn't deal with this specific case, maybe it can get you started.

--keith

Anonymous’s picture

Thanks I'll take a look, but it seems to complicated for a non-coder.

kulfi’s picture

For a list of variables available at page level/scope: http://drupal.org/node/11812
For a list of variables available at node level/scope: http://drupal.org/node/11816

As you can see, $breadcrumb is used by page level templates (e.g. page.tpl.php, page-front.tpl.php, etc), not node level.

coreyp_1’s picture

Try:


print theme('breadcrumb', $breadcrumb);

- Corey

Anonymous’s picture

Now its display "Array > Array > Array".

Do I have to add anything to template.php?

coreyp_1’s picture

That's weird. Well, try this next bit of code. If it doesn't work, then you know there is a problem somewhere else, such as any code that alters the normal breadcrumb trail.

print theme('breadcrumb', drupal_get_breadcrumb());

- Corey

Anonymous’s picture

Thank you so much!!! Now it's ok!!

TimG1’s picture

print theme('breadcrumb', array('breadcrumb'=>drupal_get_breadcrumb()));

-Tim

dgastudio’s picture

thank u!