I can see it is possible to override the breadcrumb name, but I would like to override the path the breadcrumb makes.

For example, I have a view with a contextual filter with the url of "news/%"

When there is no argument to pass, I want the url to be just "news", but the breadcrumb is making it "news/all". Is there any way to override this?

Comments

merlinofchaos’s picture

Status: Active » Fixed

Under the "Exceptions" you can change the wildcard string, which is the string we use to indicate an empty argument.

Please note that breadcrumbs can be exceptionally difficult to manipulate, so please be careful to scale back expectations on what you can actually do with them without just resorting to code that does a drupal_set_breadcrumb.

iancawthorne’s picture

I had tried the exceptions as I'd noticed it said "all" in there. Just deleting it so there is nothing in the field puts "%2A" in so the url then reads "news/%2A".

In the end I went for a drupal_set_breadcrumb() in template.php of my theme so thanks for the suggestion to try this.

merlinofchaos’s picture

Right, you can't make it empty; it really needs something to be there to identify that particular argument, unfortunately. So it looks like your solution was the best one.

iancawthorne’s picture

Just as a final follow up question to this. Is it possible to tell the view not to add anything to the breadcrumb at all?

Status: Fixed » Closed (fixed)

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

bancarddata’s picture

The views integration present in the Custom Breadcrumbs module works well also.

jlemosy’s picture

Had this issue as well and I found that the Crumbs module does a great job of fixing the problem! No more 'all's in my Views breadcrumb URLs! :)

mareks’s picture

Issue summary: View changes

Can anyone explain, how Custom Breadcrumbs or Crumbs module can fix the %2A issue in the Views Contextual filter breadcrumb?

My goal too is to remove the "all" parameter from the Views breadcrumb. Changing it to anything else won't help me. I namely want to have it blank and be dropped back into parent path where I have another page waiting :)

omerida’s picture

In #1201160: Default argument not skipped in breadcrumbs I uploaded a small patch that turns off breadcrumbs if the exception value is ''

m.attar’s picture

Hi,

I applied the bellow solution its not clean but it solve the problem:

function YOURMODULE_preprocess_link(&$variables) {

     if (arg(0) == "PATH1" and  
             arg(1) == "PATH2" and
               $variables["text"] == ITEM_NAME  and
                   $variables['path'] == ITEM_PATH) {
              
                     $variables['path'] = OVERRIDEN_PATH;
//          echo "<pre>".print_r($variables,1)."</pre>";
        }
} 

I hope this help you.
Thanks!