I will post down an image I edited to better help you understand what I'm asking for enter image description here

The reason is I've more than 50 different views that filters the same objects from a single content type based on their personal taxonomy term that differentiates them in some sub-categories, but I want those views to also have a common filter for the Year in which they were created (for development reasons, the year is a taxonomy term with just a number like "2018" "2019") so that when I want the users to view the content created this year (2019) I just have to modify one filter criteria and update it for everyone else. Currently you can only have a single filter criteria section which can either be "for all" or "for this page", this means I've to manually change the year filter for all 50 of them because I need filter criteria to be Overriden in every single view to introduce a filter for each sub categories. Is there a solution to this? a module? Or were can I find the PHP code which regolates how filters works?

  • Hi, usually module recommendations or requests for documentation links are considered off-topic. You can find a lot of information depending on your Drupal version at either drupal.org/docs and api.drupal.org/api/views regarding views – mradcliffe Jan 24 '19 at 12:36

You can't influence all Views that way at one go, that wouldn't make any sense because you can have various Views types (content, user, taxonomy term).

What you can have is a Master display within one View that can be used as a template for creating new displays. But that isn't what you're asking for.

You're asking for partial Filter handling, some Filters applied to all displays, and some Filters overridden for particular displays. But that isn't available AFAICT, at least not without complex code interventions.

But I think you might be helped with Contextual filters. Usually they are used when you need to Filter according to each taxonomy term, for example. It's tedious to create a new display for each term, instead, you let Drupal calculate that on the fly.

The same with the Date, you can use a Contextual filter on Authored on field to show only the ones from a particular year.

Automation is key when dealing with a large number of data.

Here's a couple of quick tutorials about Contextual filters: Using Drupal Contextual Filters in Views, How to use Contextual Filter in Drupal 8

| improve this answer | |
  • Thank you very much, I'll dig deep into those topics and find a way to make it work – Alessandro Conti Jan 27 '19 at 0:08

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