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>";
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | rubik-last_breadcrumb-1742552-10.patch | 1.3 KB | dsnopek |
| #3 | rubik-7.x-4.x-breadcrumb-last-item-1742552-3.patch | 535 bytes | donquixote |
| #2 | last_breadcrumb-1742552-2.patch | 1.26 KB | codesidekick |
| #1 | last_breadcrumb-1742552-1.patch | 912 bytes | codesidekick |
Comments
Comment #1
codesidekick commentedAttached 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?).
Comment #2
codesidekick commentedThis 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.
Comment #3
donquixote commentedI 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.
Comment #4
dsnopekThe patch in #2 works for me! #3 didn't quite work, for example, when editing a user.
Comment #5
haydeniv commentedI'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.
Comment #6
dsnopekOf 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!
Comment #7
donquixote commented#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
Comment #8
haydeniv commentedFair 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.
Comment #9
donquixote commentedHi
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?
Comment #10
dsnopekI'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. :-)
Comment #11
haydeniv commentedThanks for the re-roll.
Committed: 3400e7f
Thanks!
Comment #12
dsnopekAwesome! Thanks so much!
Comment #13
donquixote commentedSorry, been busy..
I will have a look next time I install Rubik.
Comment #14.0
(not verified) commentedProvided additional information that may prove useful.