Breadcrumb mystery

Events happening in the community are now at Drupal community events on www.drupal.org.
museumwebbie's picture

Some day, I'm going to have the time to migrate to the real Drupal 6 site, but meanwhile, back at the loony bin:

I'm having trouble with my breadcrumbs on one section of my site and nowhere else-- child pages in http://naturalsciences.org/nature-research-center show Home and the current page, but not the parent (nature-research-center) page, i.e. the How Do We Know page would show:

"Home > How Do We Know" instead of:

"Home > Nature Research Center > How Do We Know"

The grandchildren pages are also missing the Nature Research Center & their parent links are bad because they're missing the nature-research-center part of the path, i.e.

"Home > How Do We Know > Dinochicken" where "How Do We Know" tries to go to the non-existent "/how-do-we-know" instead of "/nature-research-center/how-do-we-know". I checked and the term hierarchy is correct.

A quick look at the installed modules shows Custom Breadcrumbs and Taxonomy Breadcrumb are both installed but neither is enabled-- I'm afraid it's another FrankenDrupal issue. I hate to ask, but could anybody take a look at this?

I'm not sure where to start, but these looked like the most relevant bits of code:

From page.tpl.php:

        <div id="breadcrumbs_bar"> 
<?php
echo breadcrumbs($GLOBALS[current_nid]);
?>
</div>

From template.php:

        /* Theme override for theme_breadcrumb
        * Adds title of current page to end of breadcrumb
        */

        function newTheme_breadcrumb($breadcrumb) {
          if (!empty($breadcrumb)) {
            //Append title of current page
            $breadcrumb[] = drupal_get_title();
               return ''. implode(' > ', $breadcrumb);
          }
        }



        if(!function_exists(breadcrumbs)){function breadcrumbs($nid, $path = null){
            global $m_data;
            global $user;

        if(!$path)
        $path = $m_data[levels];
        if(!is_array($path))
        $path = explode("/", $path);


        //create level names (used in bcrumbs)
            $current_level = end(array_keys($path));
            $terms = get_tax($m_data[tax]);
            foreach ($path as $key=>$level){
                foreach($terms as $term){

        if(make_url($level) == make_url($term[name]))
        //$test = make_url($level).' | '.make_url($term[name]);
        $m_data[levels_name][$key] = make_name($term[name]);
    }
}

$build2=null;
$build2=
'<a href="/">Home</a>';
    $build = null; $href = null;
    foreach($path as $key=>$level){
    if($m_data[levels_name][$key]){
        if($level==end($path)){
        $build .= '&nbsp;&gt;&nbsp;'.$m_data[levels_name][$key];
        } else {
        $href .='/'.make_url($level);
        $build .= ' &gt; <a href="'.$href.'">'.$m_data[levels_name][$key].'</a>';
        }
        } 
    }
$build2 = '<div id="breadcrumbs">'.$build2.$build.'</div>';

if($m_data[levels][0]!="print" and $m_data[levels][0]!="edits"){

    $printpath = $_SERVER['REQUEST_URI'].'/?print=this';

    if(substr_count($printpath, '?')>1)
    $printpath = $_SERVER['REQUEST_URI'].'&print=this';

    $build2 .=
    '<div id="print">'.
    '<a target="_blank" href="'.$printpath.'">Print this Page</a>'.
    '</div>';
}

return $build2.$test;
        }}

Comments

Hi I'm experiencing this same

Gham's picture

Hi

I'm experiencing this same issue ..

Did you find a solution ?

Thanks

G.

Sorry, no!

museumwebbie's picture

I gave up, but it's probably a peculiarity of my site because our contractor hacked the Drupal core & it's caused all sorts of problems, so even if I found a solution it probably wouldn't help other users, unfortunately. Good luck!

Hi .. I managed to find a

Gham's picture

Hi ..

I managed to find a solution myself !

It seems the 'menu breadcrumbs' module was causing the issue.
Once I disabled it I had more breadcrumbs than Hansel and Gretel. ;)

Hacking the core huh .. send him into the enchanted forest .. without breadcrumbs obviously.

Thanks for your response .. and happy to help if you need !

G.

triDUG

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: