Is it possible to invoke breadcrumbs in contemplate?

Right now I have all of the elements of my node managed by contemplate (title, post date, author, body, tags, etc) but the one thing that is still being managed by my theme (in page.tpl.php of course) is the call for breadcrumbs.

I tried using <?php print $breadcrumb; ?> but it didn't work.

Is there any way to do this with contemplate?

Comments

bradleyvance’s picture

Assigned: bradleyvance » Unassigned
jrglasgow’s picture

use drupal_get_breadcrumb() to get the breadcrumb, to set the breadcrumb you would use drupal_set_breadcrumb()

bradleyvance’s picture

Please pardon my ignorance, and thank you for your fast reply, but how would I use this in Content Template? I tried using <?php print drupal_get_breadcrumb() ?>, but that just gave me the text "Array"

I also tried pasting the code from the linked page

<?php
function drupal_get_breadcrumb() {
  $breadcrumb = drupal_set_breadcrumb();

  if (is_null($breadcrumb)) {
    $breadcrumb = menu_get_active_breadcrumb();
  }

  return $breadcrumb;
}
?>

but that gave me a fatal error and forced me to delete the template.

My humble thanks in advance.

feuillet’s picture

Is there no solution to display the actual breadcrumb inside contemplate?

jrglasgow’s picture

drupal_get_breadcrumb() returns a list of breadcrumb items in the form of an array.

To display the breadcrumb:

$crumb = drupal_get_breadcrumb();
print implode(' >> ', $crumb);
feuillet’s picture

Works great, thanks!

jrglasgow’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.