I'm using preprocess_views_view to define some new variables and pass them to a twig template.
In order to define these variables I need to access the exposed filters input values, but I can't seem to figure out how:
function my_modules_preprocess_views_view(&$variables) {
$view = $variables['view'];
// Here I would need to access the exposed filters value
$exposed_filter_value = "the_value";
$variables["foo"] = "Something based on the exposed filters value";
}
I would be very grateful for any clues - cheers!
In a
hook_preprocess_views_view()implementation in your theme or module:Or, you can access the values directly from the
views-view.html.twigtemplate: