I tried to use version 6.x-1.4 with two different custom breadcrumbs set up for node type 'page', with different visibility filters. Individually they both work but only the first one is seen. I notice there is a patch at http://drupal.org/node/276817 that 'needs work' to fix this. I looked at 6.2-dev to see what was in it and I see that it has paths selection as an alternative to node type. This is exactly what I want anyway. The question is - is there a way to put a wild card into the path. I want to define the breadcrumb for paths 'internal', 'internal/meetings', 'internal/reports' etc., with the breadcrumb being the same in all cases.

Comments

MGN’s picture

Title: Using paths in version 6.2-dev » Allow for wildcard matching in custom breadcrumbs for paths
Component: Documentation » Code
Category: support » feature

This is not currently possible, but would not be difficult to implement. I'll see if I can work it into custom_breadcrumbs_paths. Thanks for the suggestion!

Tony Sharpe’s picture

Thanks, that would be great!

MGN’s picture

Status: Active » Fixed

I just added this feature to 6.x-2.x-dev custom_breadcrumbs_paths. It should be available in the next nightly dev snapshot if you would like to test it out.

Tony Sharpe’s picture

Thanks very much for this. I've just downloaded dev - May 10th, but I don't see anything different. What syntax should I use for the path to cover 'internal', 'internal/meetings', 'internal/reports' etc
Thanks again.

MGN’s picture

Sorry I haven't had a chance to document it yet. I've made the wildcard matching optional, so you need to activate it by checking the box Use wildcard pattern matching in paths at the custom breadcrumb admin settings page (admin/settings/custom-breadcrumbs). Then, instructions about using the wildcard

The drupal path that this custom breadcrumb trail will apply to. The '*' character can be used as a wildcard to set a custom breadcrumb for all matching paths. For example, foo/bar/* could be used to match every page with a path beginning with foo/bar.

will appear on the form where you add the specific path custom breadcrumb.

EDIT: The reason its optional is because in order to do the matching, custom breadcrumbs must load and try to match all of the breadcrumbs in the custom_breadcrumbs_paths table. There might be a performance cost associated with this option on sites with many custom_breadcrumbs_paths breadcrumbs. By default I am leaving this off until it can be properly tested.

Tony Sharpe’s picture

Fantastic. It works exactly as required.
Thank you.

MGN’s picture

Great. Please be on the lookout for anything that doesn't work as expected. It has not been tested thoroughly yet, and we are still fixing the views support. Your feedback is appreciated!

Status: Fixed » Closed (fixed)

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