4

I use the theme "Bootstrap".

When I display a node, there is no breadcrumb. My nodes are related to taxonomy terms.

On the screenshots :

Boutique / Les chocolats BIO

The second screenshot should be :

Boutique / Les chocolats BIO / Tablette de chocolat noir artisanale BIO aux épices tchaï

"Boutique" is the vocabulary of taxonomy and "Les chocolats BIO" is the terms of taxonomy.

How to display the breadcrumb on the nodes without using any additional modules ?

enter image description here

enter image description here

6
  • @Wim Mostrey Make a customized module. Does not work with template.php ?
    – user54067
    Commented Jan 28, 2017 at 22:08
  • I updated my question
    – user54067
    Commented Jan 29, 2017 at 20:26
  • @Wim Mostrey How do I do this with template.php? Can you make an answer? Thank you
    – user54067
    Commented Jan 29, 2017 at 23:52
  • @Wim Mostrey Thank you. How to call "theme_breadcrumb()" ? Can put an answer ?
    – user54067
    Commented Feb 1, 2017 at 23:18
  • 1
    Generally you wouldn't do this in the theme. If the breadcrumbs were already there and you wanted to change their display in some way it would go there, however you are actually setting the breadcrumbs themselves, which should be done in a custom module using drupal_set_breadcrumb(). - Or with an already available module, for example drupal.org/project/path_breadcrumbs
    – rooby
    Commented Feb 2, 2017 at 6:32

1 Answer 1

1

you can implement hook_node_view and make alterations in the breadcrump eg:

/*
 * Implements hook_node_view().
 */
function my_custom_module_node_view($node, $view_mode) {
  if ($node->type == 'my-node-type') {
    $type == $node->field_test_field['und'][0]['value'];
    if ($type == 0) {
      $breadcrumb = drupal_get_breadcrumb();
      $breadcrumb[1] = 'new breadcrumb';
      drupal_set_breadcrumb($breadcrumb);
    }
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.