The breadcrumb trail is displaying two identical trails, one right on top of the other but slightly offset making it all but impossible to read. This only occurs in UIE Forums and only affects the links in the trail to the right of "Home". See screen capture below. Anyone have any ideas?

CommentFileSizeAuthor
breadcrumb.jpg24.06 KBstandardhuman

Comments

standardhuman’s picture

FYI, It should read Hom > Forums > Forum > Thread

daniel.hunt’s picture

I've seen this aswell, but it only happens for me in the garland theme.

I have absolutely no idea why its happening :s

MikeyGYSE’s picture

could it be something to do with the way Garland layers the images in the header?

daniel.hunt’s picture

Well I dont actually understand how it could be happening - I'm doing no different in the code on other themes :)

I'm going to have another stab at it tomorrow, I really want to find out what the hell is going on :)

daniel.hunt’s picture

Honestly guys, I don't know what's causing this.

I'll start asking the drupal.org people in irc because I can't solve this one on my own.

Daniel

Vallenwood’s picture

Title: Duplicate breadcrumb trails » Duplicate breadcrumb trails FIX

I found the problem. In uieforum.module, on line 892, you'll find:

$page_content .= "<br /><br />".theme_breadcrumb($breadcrumbs);

There are two problems with this:

  1. The theme function is called incorrectly. Remember, in Drupal you don't call theme functions directly, you call them via the theme function. It's not theme_breadcrumb($breadcrumbs), it's theme('breadcrumb',$breadcrumbs). *wags finger* bad coding practice. bad! no soup for you.
  2. If you look at the "style.css" for the Garland theme, the breadcrumb trail is set to position: absolute. When you write the duplicate breadcrumb trail, which is supposed to go underneath the forum, it's positioned absolutely so it goes right on top of the other one!

The solutions are easy, and there are two of them:

  1. Fix the "theme" call.
    Line 892 must be changed from:
    $page_content .= "<br /><br />".theme_breadcrumb($breadcrumbs);
    to:
    $page_content .= "<br /><br />".theme('breadcrumb',$breadcrumbs);
    This alone will solve the problem, because now that the theme function is properly called, its styles are also properly rendered according to the Garland theme function override (rather than the built-in Drupal default), and the the two "stacked" breadcrumbs will now line up exactly with one another and look like a single trail. Note that this is not actually the solution, it just removes the offset effect. (And brings the code up to spec.)
  2. Optional: IF you are using a theme (such as the default Garland) where the "breadcrumb" style declaration is position: absolute, change it in your theme's "style.css" so that it isn't anymore. However, some themes are SUPPOSED to have this be absolute, so this may not work for you. The ideal solution is:
  3. Create a brand-new theme function just for the second breadcrumb trail and call that instead of the normal one. Here's how. Change the newly-updated line 892 from:
    $page_content .= "<br /><br />".theme('breadcrumb',$breadcrumbs);
    to:
    $page_content .= "<br /><br />".theme('uieforum_breadcrumb',$breadcrumbs);
    and then at the bottom of the module, create a new theme function:
    /**
     * Custom theme function for the breadcrumb trail underneath a UIEforum page.
     */
    function theme_uieforum_breadcrumb($breadcrumb) {
      if (!empty($breadcrumb)) {
        return '<div class="breadcrumb_uieforum">'. implode(' › ', $breadcrumb) .'</div>';
      }
    }
    

    Then add a .breadcrumb_uieforum declaration in your theme's "style.css" file (probably based loosely on the existing .breadcrumb declaration) which is NOT position absolute, and is otherwise styled how you want.
    Now theme designers can override this as desired, and the problem is 100% fixed!

Hope this takes care of the problem. *dusts off jeans*

standardhuman’s picture

Excellent! Works perfectly. Thank you so much for your work!

daniel.hunt’s picture

nicely done!

daniel.hunt’s picture

Assigned: standardhuman » daniel.hunt
Status: Active » Fixed

I can't believe I didnt add this to the code ...
Apologies :)

Thanks again for the fix!
Daniel

Anonymous’s picture

Status: Fixed » Closed (fixed)
sgriffin’s picture

This has not been fixed in uieforum-5.x-1.x-dev.tar.gz 11/14/07

sgriffin’s picture

I was able to remove the second lower breadcrumb with checking ->configure -> misc
Displays the Userbar above all Forum Views.

Bug report.. for some reason there are two identical lines of this setting.

daniel.hunt’s picture

SGriffin - this is a theme problem, not a UIEForum one.