0

or How to remove the exception parameter of a View's contextual filter

Hi,

In Drupal 7 I have a View with two contextual filters (date field):

/view-url/YEAR/MONTH

When YEAR is the first argument and if there is none I make a Summary of the view, so the result can be something like:

* 2017
* 2016
* 2015

And MONTH is the second parameter, that if it's not present, the view also makes a Summary:

* January
* February
* ...

I think that I'm stuck replicating the same View in Drupal 8, because the first Summary has a default parameter "all" wich is the exception of the second parameter.

  1. Is there a way to remove that default exception parameter from the url of the first summary? (I'm getting view-url/YEAR/all for each year of the list as its url).
  2. Can I expose YEAR and MONTH so people can easily navigate trough the view?

Also if there is a better way to built that kind of view (like better performance) I'll apreciate the advice.

0

You can override the parameters in each individual display. I'm not sure about D8, but in D7, the "display order" of the displays was important as well, such that you'd get the behavior of the higher priority display (lower display order) as desired. In D7, I had to go into the database itself, and change the "position" of these pages in the "views_display" table. (I know of no way to do this in the UI.)

  • Thanks for your answer, but look that this is a Drupal 8 question not a D7 one, and I'm also clear pointing that I have the View working on D7, I never had to touch the database on D7. – Yaazkal Dec 1 '17 at 20:49
  • You can't override the parameters per display? – beltouche Dec 1 '17 at 20:55

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.