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

Comments

drupalhooked’s picture

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

MGN’s picture

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.

MGN’s picture

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.

MGN’s picture

Status: Active » Needs review
StatusFileSize
new3.25 KB
new3.25 KB

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.

MGN’s picture

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.

MGN’s picture

StatusFileSize
new3.25 KB

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.

MGN’s picture

StatusFileSize
new3.25 KB

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.

MGN’s picture

Status: Needs review » Postponed (maintainer needs more info)
MGN’s picture

Status: Postponed (maintainer needs more info) » Needs review
MGN’s picture

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.

Status: Fixed » Closed (fixed)

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