Timeline for How to pass variable to a views template?
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 28, 2019 at 12:38 | answer | added | M.Zandy | timeline score: 1 | |
Jan 28, 2019 at 9:54 | comment | added | berramou | great, you are welcome. | |
Jan 28, 2019 at 9:51 | comment | added | TBJ | berramou: I finally got it to work by changing the template filename to a shorter name and using the exact same name in the preprocess function. See my answer below. Thank's for helping. | |
Jan 28, 2019 at 9:49 | answer | added | TBJ | timeline score: 0 | |
Jan 28, 2019 at 9:41 | comment | added | berramou |
To variable to view tpl $vars['test'] = 'Filtertest'; should works, just be sure that you in the right tpl .
|
|
Jan 28, 2019 at 9:31 | comment | added | TBJ | Yes, you are right, I have changed that now, The template is called and works, so i suppose it should be possible to pass variables to it? | |
Jan 28, 2019 at 9:20 | comment | added | berramou |
it's better to check first on view name like if($vars['view']->name == 'your_view_name') { $vars['test'] = 'Filtertest'; } , and make sure that views-view-responsive-grid--taxonomy-term.tpl.php the right tpl for this view, and flush all caches
|
|
Jan 28, 2019 at 9:07 | history | asked | TBJ | CC BY-SA 4.0 |