I have a view that displays news articles by year, with the year given as a contextual filter received via the URL.

When no argument is present, I have views set a default argument of todays date, so it will show all of the news articles for 2013 when someone goes to /news. If they go to /news/2012, it would display the 2012 articles.

I've noticed that views is setting the breadcrumb to include "News" and the path to the main view when no argument is present, AKA going to /news. Based on the URL path, it doesn't make sense to display a breadcrumb to the main news page. I can sort of understand why this happens. Since I'm essentially telling views that there IS an argument, it doesn't know that it shouldn't display a breadcrumb.

What is the best approach to handle this situation? I'd like the breadcrumb to appear only when the contextual filter is present. If I could just disable breadcrumb handling completely, I suppose I could use another module to set the breadcrumb manually based on how I want it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.