Closed (fixed)
Project:
Crumbs, the Breadcrumbs suite
Version:
7.x-1.0-alpha6
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2012 at 18:02 UTC
Updated:
25 Sep 2012 at 11:53 UTC
Jump to comment: Most recent file
Comments
Comment #1
donquixote commentedCan you tell me
- what kind of page that is where you want this specific breadcrumb to show up
- which breadcrumb items you intend to see (path and title)
- which breadcrumb items show up instead?
Comment #2
kingdee40 commentedWell I am using path and it is working as designed.
For Taxonomy term pages:
Continent (term)
-Country (sub term)
--State (sub sub term)
---City (sub sub sub term)
While I am viewing State, it is currently showing up as:
Continent >> Country
Which I expected because path "Chops off the last fragment of the path alias, consider the result as the parent path."
While viewing State I'd like to see
Continent >> Country >> State
Same for City.
And btw, I tried all other breadcrumb modules and Crumbs is the only one that works for me so Thank you.
Comment #3
donquixote commentedI see!
What you are looking for is more about display than trail generation.
Crumbs does calculate the complete trail, that includes the page you are currently viewing as the last item.
However, it will then allow the usual breadcrumb display functions to remove that last item, that is, to not display it.
I did consider to make this behavior overridable with Crumbs. However, some themes out there (Zen, in particular) already do this on their own: They provide a checkbox to either show or hide the last fragment. Other themes have other ideas about how the breadcrumb is to be displayed.
This is why I hesitated to let Crumbs mess with the breadcrumb display, and instead behave to those themes as if they were dealing with the core breadcrumb.
However, I do make the full crumbs trail (including the last item) available to theme('breadcrumb') via an extra variable.
This way, themes that know about Crumbs can easily use that last item.
What you can do is implement theme_breadcrumb with your own theme, and do your magic to it.
------
If you have any suggestion how I could improve this to not conflict with "themes that want to be smart", let me know!
Comment #4
kingdee40 commentedHmm, maybe my theme isn't crumbs aware, I will have to play with this some more.
Most themes I have used provide control over "Home" settings or last fragment (or both).
I would suggest a "fullpath" -Includes the last fragment of the path alias.
The code would be almost Identical to the "path" but the user would select one or the other.
Comment #5
donquixote commentedI don't know of any theme in contrib that is crumbs aware. Crumbs is simply not known enough to be picked up by contrib themers.
However, your custom theme (which can be a sub-theme of a contrib theme) can easily be made to use the full crumbs trail, by implementing theme_breadcrumb - that is, "MYTHEME_breadcrumb()".
Comment #6
duaelfrI agree your position donquixote but in the crumbs.module file around line 146 you pop out the last breadcrumb item and just throw it.
As this element has been built by your module (specially the link_title value), I think it would be usefull to keep it in the final array without adding it to the breadcrumb. As kingdee, I have to output the current page in the breadcrumb and with the actual code I have to rebuild the entire array just to get de title of the last element (see following samples). I hope this humble contribution will help this module to grow because at this day it is the only one which fully meet my needs ;)
Without my patch :
With my patch :
Comment #7
donquixote commentedNice catch!
I have not touched this part of crumbs for a while..
Here is another patch.
Instead of adding an item that has been previously removed, let's just not remove it :)
With my patch:
(or do sth equivalent in a preprocess function)
Warning: This is not tested at all :)
Comment #8
duaelfr+1 RTBC
For those who do not want a link on the last breadcrumb item :
Comment #9
donquixote commentedRTBC = you tested?
sorry, don't get it..
those who do not want the last item just do nothing.
Those who do want, use the code as in #7..
Comment #10
duaelfrYes I tested and it works well thank you.
A lot of people want the current item to appear as the last part of the breadcrumb but not being linked because it would be ergonomically confusing for users. My snippet is for those people ;)
Comment #11
donquixote commentedGreat!
Comment #12
donquixote commentedThanks a lot DuaelFr!
Did the "no wsod" test, committed and pushed to 7.x-1.x branch.
It will be included in the next point release (I think I should move to beta or rc or stable finally)
Comment #13
donquixote commentedComment #15
donquixote commentedI want to point out a recent change in
#1778236: Rework the way the current page is handled in the breadcrumb
You can play with the -dev version, and post your feedback there!