Hi, I have what is probably a very simple issue with the breadcrumb trail in Rubik, specifically the last element.

As this element is not required to be output as a link it is not receiving the css for that, and I notice that it is displayed approx. 5px higher than the earlier breadcrumbs and slightly too far to the left underneath the bleed image.

I'm not very good with php but have had a look into the template.php to see if I can figure anything out but I can't see the wood for the trees. I think this last element needs to have an <a href="#"> atrribute applied to it somehow as when this is added in Firebug the crumb displays properly.

Thanks for your patience.

Edit: Also, the following snippet of code which is supposed to handle display of the current pages crumb appears to do nothing as when it is commented out nothing changes:

  // Add current page onto the end.
  if (!drupal_is_front_page()) {
    $item = menu_get_item();
    $end = end($vars['breadcrumb']);
    if ($end && strip_tags($end) !== $item['title']) {
      $vars['breadcrumb'][] = "<strong>". check_plain($item['title']) ."</strong>";


codesidekick’s picture

new912 bytes

Attached is a patch that forces the strong tag on the last element of the breadcrumb trail. Includes a CSS failsafe in case the last breadcrumb is a link (would this happen?).

codesidekick’s picture

new1.26 KB

This actually seems to be a larger issue as occasionally items in the middle of the breadcrumb aren't presented as links (eg when editing nodes).

This patch checks if the breadcrumb is a link and wraps it in a strong tag if it isn't.

donquixote’s picture

Category:support» bug
Status:Active» Needs review
new535 bytes

I can confirm the problem.
Setting it to "bug report", because it causes "broken" appearance.

Here is another patch, which only solves the last item issue. i think it is better than #1, because it avoids duplicate <strong> tags, or link nested in the strong tag.

However, it does not solve the issue mentioned in #2. So I think we need a combination of this patch and #2.

dsnopek’s picture

Status:Needs review» Reviewed & tested by the community

The patch in #2 works for me! #3 didn't quite work, for example, when editing a user.

haydeniv’s picture

Status:Reviewed & tested by the community» Needs work

I'm not sure a strong tag is the way to fix this issue. I would rather see this more html5 compliant and follow core's example for d8: #1347266: Convert theme_breadcrumb() to HTML5
That way it is one less thing to fix later.

dsnopek’s picture

Of course this is up to the maintainers, but I think it'd be best to fix the bug and rework the breadcrumbs to be HTML5 in seperate issues. Rubik currently isn't HTML5 and this patch certainly doesn't make it any worse!

donquixote’s picture

#6: I was going to say the same :)

#2, #4: I like the patch from #2, too. It also looks like it solves the issue I mentioned in #3.
Although.. if a breadcrumb module already wraps the breadcrumb in a strong tag, then we risk two strong tags nested within each other. So maybe do an additional check

    if (!preg_match('/^<a/', $link) && !preg_match('/^<strong/', $link)) {
      $link = '<strong>' . $link . '</strong>';
haydeniv’s picture

Fair enough. Get me a complete patch and open a follow up and I'll commit it right away.

As a side note, there are several patches that Need Review that could really use some love. This is my shameless plug to enlist some review help. :) I just took over maintainership and could really use the help. I'm a very responsive maintainer and do releases promptly so fixed bugs don't just sit out in -dev and people feel like their efforts are wasted.

donquixote’s picture

I am currently being distracted on all fronts, so I will probably not do much for you..

Just a quick note on the HTML5: I think this would be better off in a new branch or even a new theme. And would probably make more sense if the tao base theme was more HTML5-ish. #1107102: Tao further development and HTML5?

dsnopek’s picture

Status:Needs work» Needs review
new1.3 KB

I've re-rolled the patch against the latest 7.x-4.x and included the changes from donquixote in #7. It works for me!

Since I've got my hands in it, I don't think it's fair for me to mark as RTBC. Could someone (maybe even @donquixote?) try the patch and verify that it works for you?

@haydeniv: Thanks for taking up Rubik! I'll try to find sometime to review patches in the queue. Even with all it's bugs in Drupal 7, Rubik is still my favorite admin theme. :-)

haydeniv’s picture

Status:Needs review» Fixed

Thanks for the re-roll.

Committed: 3400e7f


dsnopek’s picture

Awesome! Thanks so much!

donquixote’s picture

Could someone (maybe even @donquixote?) try the patch and verify that it works for you?

Sorry, been busy..
I will have a look next time I install Rubik.

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

Anonymous’s picture

Issue summary:View changes

Provided additional information that may prove useful.