I'm looking to prepend an arbitrary static breadcrumb to certain nodes, have the active menu trail breadcrumbs appear, then append the non-clickable page title. I imagine it will be something like:
Arbitrary Static Link
something to fetch the active menu trail titles
[title]
/url
something to fetch the active menu trail paths
I've been searching for the php snippets to finish this off, but I haven't been able to locate them and don't know how to build them myself. If anyone could point me in the right direction or suggest an alternate way to accomplish the task, it would be very much appreciated.
Comment | File | Size | Author |
---|---|---|---|
#10 | custom_breadcrumbs-789716-2.patch | 3.87 KB | derhasi |
#9 | 754494-menu_parent_identifier.patch | 3.74 KB | MGN |
#7 | custom_breadcrumbs-789716.patch | 3.43 KB | derhasi |
#4 | screen 2010-05-09 um 17.43.13.png | 35.25 KB | derhasi |
#4 | screen 2010-05-09 um 17.43.33.png | 47.88 KB | derhasi |
Comments
Comment #1
eliza411 CreditAttribution: eliza411 commentedSorry, I didn't format the example properly:
Comment #2
MGN CreditAttribution: MGN commentedI think this may be possible with derhasi's cb_menuidentifier module at http://github.com/derhasi/dev/tree/custom_breadcrumbs_identifier/cb_menu...
I haven't tried this, but it provides a special identifier
that could work for you.
Titles
Paths
Comment #3
eliza411 CreditAttribution: eliza411 commentedIt sure does look like what I need, but no luck with either 6.x-2.0-beta3 or 6.x-2.x-dev. The Static link and title appear, but there's nothing between them on the page or in the source and no error messages. I'll keep an eye on that module's development and keep looking for a solution, too.
Thanks for pointing me at the github link. I'm not sure how I'd find that otherwise.
Comment #4
derhasi CreditAttribution: derhasi commented@eliza411 - I tested the module again with the current 6.x-2.0-beta3, all works fine though. Contrary to MGNs statement your configuration of path should contain the line
<parent-menu-trail>|node/[nid]
, as the parent menu trail works on any path you give it. I attached two screenshots that show the usage of the menu trail identifier.@MGN, as menu is part of Drupal core, I'd suggest to implement this menu trail feature as part of the custom_breadcrumbs_identifiers.module. If you agree with this I'd write a pathc for that.
Comment #5
MGN CreditAttribution: MGN commented@derhasi, thanks for clearing that up. I haven't actually tried it so I really appreciate your input. I would be happy to include it in the custom_breadcrumbs_identifiers.module, if you would like to submit a patch against the current dev. Thanks again!
Comment #6
eliza411 CreditAttribution: eliza411 commented@derhasi - Without the |node/[nid] , nothing appeared at all. When I properly configure it per your directions, it works like a charm.
Thank you both for your work and your help on this issue!
Comment #7
derhasi CreditAttribution: derhasi commentedAs announced I implemented the functionality of my github module to the custom_breadcrumbs_identifiers. I changed the identifier from
<parent-menu-items>
to<menu-parent-items>
.The patch is attached and applies on the current cvs repo. @eliza411, it was nice you'd review the patch.
Comment #8
eliza411 CreditAttribution: eliza411 commentedI was able to apply the patch cleanly. I updated the syntax in my config, and it worked as expected. Thanks again.
Comment #9
MGN CreditAttribution: MGN commentedGreat. Thanks again for contributing this! I have one suggestion for improvement and a few cosmetic changes to the documentation.
Rather than requiring the identifier to be used with a path (which will usually be node/[nid]), lets use the current path as a default value if no path is provided.
I don't think this should cause any problems, but thought it would be good to have someone else check before committing...
EDIT: Somehow I got the wrong issue number in the patch...
Comment #10
derhasi CreditAttribution: derhasi commentedThe patch works fine so. I only changed some spelling error in the description.
Attached the changed version.
Comment #11
MGN CreditAttribution: MGN commentedThanks for the review. Committed to cvs http://drupal.org/cvs?commit=367924
Comment #13
hanoiiI just entered #1234566: new identifiers: menu-item-by-path, menu-item-by-id (I only just noticed the actual issue number, almost a "straight"), testers appreciated!
anyway...
I had issues by using this on a path that has more than one menu entry. This will only use the first item from the db which might not be the one needed for the breadcrumb.
I propose a modification including the approach I did in the linked issue, which basically is doing both a
menu-parent-trail-by-path (the actual one)
menu-parent-trail-by-id (a new one with a very similar code that will query the menu item by id instead of by path)
If this is wanted/acceptable I don't mind rolling a patch.
Comment #14
lamp5