Skip to main content
edited body
Source Link
arpitr
  • 7.9k
  • 2
  • 23
  • 48

As an last option you can implement theme_breadcrumb() in your theme template.php

Something like below sample code.

function themename_breadcrumb($variables) {
  if (arg(0) == "galery" && is_numeric(arg(1))) {
    
    // Get event title of the  event
    $event_nids = mymodulename_get_back_refernce_value(arg(1));
   
    // Note since a gallery can be referred by multiple event nodes so you have add logic which one you need to pick here, for now I am picking with array index as 0
    $event_node = node_load($events_nids[0]);

    $links[0] = l(t('Home'), '<front>');

   // inplace of 'events' add internal link path to events page.
    $links[1] = l(t('Events'),'events');
    $links[1]$links[2] = l(t($event_node->title),'node/'.$event_node->nid);
    $links[1]$links[3] = t('schedule');
    drupal_set_breadcrumb($links);
  }
}

As an last option you can implement theme_breadcrumb() in your theme template.php

Something like below sample code.

function themename_breadcrumb($variables) {
  if (arg(0) == "galery" && is_numeric(arg(1))) {
    
    // Get event title of the  event
    $event_nids = mymodulename_get_back_refernce_value(arg(1));
   
    // Note since a gallery can be referred by multiple event nodes so you have add logic which one you need to pick here, for now I am picking with array index as 0
    $event_node = node_load($events_nids[0]);

    $links[0] = l(t('Home'), '<front>');

   // inplace of 'events' add internal link path to events page.
    $links[1] = l(t('Events'),'events');
    $links[1] = l(t($event_node->title),'node/'.$event_node->nid);
    $links[1] = t('schedule');
    drupal_set_breadcrumb($links);
  }
}

As an last option you can implement theme_breadcrumb() in your theme template.php

Something like below sample code.

function themename_breadcrumb($variables) {
  if (arg(0) == "galery" && is_numeric(arg(1))) {
    
    // Get event title of the  event
    $event_nids = mymodulename_get_back_refernce_value(arg(1));
   
    // Note since a gallery can be referred by multiple event nodes so you have add logic which one you need to pick here, for now I am picking with array index as 0
    $event_node = node_load($events_nids[0]);

    $links[0] = l(t('Home'), '<front>');

   // inplace of 'events' add internal link path to events page.
    $links[1] = l(t('Events'),'events');
    $links[2] = l(t($event_node->title),'node/'.$event_node->nid);
    $links[3] = t('schedule');
    drupal_set_breadcrumb($links);
  }
}
Source Link
arpitr
  • 7.9k
  • 2
  • 23
  • 48

As an last option you can implement theme_breadcrumb() in your theme template.php

Something like below sample code.

function themename_breadcrumb($variables) {
  if (arg(0) == "galery" && is_numeric(arg(1))) {
    
    // Get event title of the  event
    $event_nids = mymodulename_get_back_refernce_value(arg(1));
   
    // Note since a gallery can be referred by multiple event nodes so you have add logic which one you need to pick here, for now I am picking with array index as 0
    $event_node = node_load($events_nids[0]);

    $links[0] = l(t('Home'), '<front>');

   // inplace of 'events' add internal link path to events page.
    $links[1] = l(t('Events'),'events');
    $links[1] = l(t($event_node->title),'node/'.$event_node->nid);
    $links[1] = t('schedule');
    drupal_set_breadcrumb($links);
  }
}