Skip to main content
removed "Drupal" and tags from the title
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

Drupal 8 - Dynamic Viewsview filter value

Source Link

Drupal 8 - Dynamic Views filter value

I'd like the ability to change a View's filter value prior to rendering, specifically add a taxonomy filter to certain pages. The reason I need this, is to have one Views block, and the ability to filter based off the URI, without adding a contextual taxonomy id to the URI. I haven't been able to find a way to handle this in any hook, but I think that's where I should be looking. I've been using the MODULE_views_pre_view hook without any luck.

Right now, the only way I've gotten around this is to duplicate the Block over and over again, and it's starting to get messy.

I've found several articles, but they're all for Drupal 7.