dynamic breadcrumb for views based on menu tree

drupalhooked - June 8, 2009 - 12:11
Project:Custom Breadcrumbs
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I 've my menu structure like this.

Item1
item1.1
item1.2
item1.2.1
item1.2.2
item2
item2.1
item2.2

when i click on item1.2.1 which is linked to a node view page. Using menu_breadcrumb module I have my breadcrumb like this Home>>item1>>item1.2>>item1.2.1 . it fine.
again I ve a menu item 1.2.2 which linked to some view page, my breadcrumb becomes Home>>item1.2.2 instead of Home>>item1>>item1.2>>item1.2.2.

I used custom_breadcrumb module for that, which works fine but I have put all breadcrumb item manually.

Is there any we to create the breadcrumb for views dynamically like its happening in case of node using menu_breadcrumb.

Thanks

#1

drupalhooked - June 8, 2009 - 12:12

Item1
....item1.1
....item1.2
......item1.2.1
......item1.2.2
item2
....item2.1
....item2.2

#2

MGN - June 9, 2009 - 22:46
Component:Miscellaneous» Code

So if I understand correctly, you want the breadcrumb structure to match the menu structure when on a views page.

And rather than typing this in manually, you would like an option to match the menu structure automatically (i.e. dynamically)?

I haven't looked too deeply into this yet, but I am pretty sure this is a reasonable feature request, since we are already handling breadcrumbs for views, and the menu api already provides all the code we would need to set the breadcrumb trail correctly.

#424464: CB for Views: let views create customizable breadcrumbs might be related. You might want to try out that patch and see if it will do what you are looking for.

#3

MGN - June 9, 2009 - 22:49
Title:dynamic braedcrumb for views» dynamic breadcrumb for views based on menu tree
Version:6.x-1.4» 6.x-2.x-dev

If implemented, this would go to 6.x-2.x-dev.

#4

MGN - June 14, 2009 - 01:32
Status:active» needs review

This patch adds an option to use the menu structure for the default breadcrumb trail (on the Site configuration >> custom breadcrumbs settings page). If that option is checked then hook_init is used to set the breadcrumb trail for all page types, including views pages. If a custom breadcrumb is defined for a page, then that breadcrumb will be used instead of the default.

I've done some limited testing and it seems to work on views in menu structures like that described in #1.

Some of the code is directly from the menu_breadcrumb module, just implemented within the custom_breadcrumbs structure, so don't run both modules at the same time.

Let me know if this works for you.

AttachmentSize
485062_dynamic_menu_breadcrumbs.diff 3.25 KB

#5

MGN - June 14, 2009 - 01:32

This patch adds an option to use the menu structure for the default breadcrumb trail (on the Site configuration >> custom breadcrumbs settings page). If that option is checked then hook_init is used to set the breadcrumb trail for all page types, including views pages. If a custom breadcrumb is defined for a page, then that breadcrumb will be used instead of the default.

I've done some limited testing and it seems to work on views in menu structures like that described in #1.

Some of the code is directly from the menu_breadcrumb module, just implemented within the custom_breadcrumbs structure, so don't run both modules at the same time.

Let me know if this works for you.

#6

MGN - June 14, 2009 - 01:33

This patch adds an option to use the menu structure for the default breadcrumb trail (on the Site configuration >> custom breadcrumbs settings page). If that option is checked then hook_init is used to set the breadcrumb trail for all page types, including views pages. If a custom breadcrumb is defined for a page, then that breadcrumb will be used instead of the default.

I've done some limited testing and it seems to work on views in menu structures like that described in #1.

Some of the code is directly from the menu_breadcrumb module, just implemented within the custom_breadcrumbs structure, so don't run both modules at the same time.

Let me know if this works for you.

AttachmentSize
485062_dynamic_menu_breadcrumbs.diff 3.25 KB

#7

MGN - June 14, 2009 - 01:35

This patch adds an option to use the menu structure for the default breadcrumb trail (on the Site configuration >> custom breadcrumbs settings page). If that option is checked then hook_init is used to set the breadcrumb trail for all page types, including views pages. If a custom breadcrumb is defined for a page, then that breadcrumb will be used instead of the default.

I've done some limited testing and it seems to work on views in menu structures like that described in #1.

Some of the code is directly from the menu_breadcrumb module, just implemented within the custom_breadcrumbs structure, so don't run both modules at the same time.

Let me know if this works for you.

AttachmentSize
485062_dynamic_menu_breadcrumbs.diff 3.25 KB

#8

MGN - June 19, 2009 - 21:56
Status:needs review» postponed (maintainer needs more info)

#9

MGN - June 20, 2009 - 03:16
Status:postponed (maintainer needs more info)» needs review

#10

MGN - June 26, 2009 - 12:45
Status:needs review» fixed

Thanks. I';ve tested this patch on a couple of sites over the last week and it seems to be working fine. I've committed this to 6.x-2.x-dev for further testing. If there are problems, please open a new issue.

#11

System Message - July 10, 2009 - 12:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.