How to pass variable to a views template? I have this in my template.php:

function mytheme_preprocess_views_view(&amp;$vars) {
$vars['test'] = 'Filtertest';
}


And this in my views-view-responsive-grid--taxonomy-term.tpl.php:

&lt;?php print $test; ?&gt;


... this does not work though. The template is called and works but my $test variable does not get printed.

What am I missing here? Any help is greatly appreciated.
Replace this, with your function

public static function mytheme_preprocess_views_view(&amp;$vars) {
  $vars['test'] = 'Filtertest';
  return $vars['test'] ;
}


Then use this short code on your twig view:

{{ test }}


or if wanna use it in something.php in your views:

dump(test )