Skip to main content

Your problem is that the output for the view is built up from the inside-out. So, the views-view template already has the processed results from the views-view-unformatted template.

You should just be able to implement a template_preprocess_views_view_unformatted(), and do a manual check:

function mytheme_preprocess_views_view_unformatted(&$variables) { $view = $variables['view']; if ($view->name == 'viewname') { $variables['foo'] = 'bar'; } } 

I don't typically use the with the unformatted output, but I do it somewhat often at the field level.

Your problem is that the output for the view is built up from the inside-out. So, the views-view template already has the processed results from the views-view-unformatted template.

You should just be able to implement a template_preprocess_views_view_unformatted(), and do a manual check:

function mytheme_preprocess_views_view_unformatted(&$variables) { $view = $variables['view']; if ($view->name == 'viewname') { $variables['foo'] = 'bar'; } } 

I don't typically use the with the unformatted output, but I do it somewhat often at the field level.

Your problem is that the output for the view is built up from the inside-out. So, the views-view template already has the processed results from the views-view-unformatted template.

You should just be able to implement a template_preprocess_views_view_unformatted(), and do a manual check:

function mytheme_preprocess_views_view_unformatted(&$variables) { $view = $variables['view']; if ($view->name == 'viewname') { $variables['foo'] = 'bar'; } } 

I don't typically use unformatted output, but I do it somewhat often at the field level.

Source Link
mpdonadio
  • 38.1k
  • 8
  • 90
  • 143

Your problem is that the output for the view is built up from the inside-out. So, the views-view template already has the processed results from the views-view-unformatted template.

You should just be able to implement a template_preprocess_views_view_unformatted(), and do a manual check:

function mytheme_preprocess_views_view_unformatted(&$variables) { $view = $variables['view']; if ($view->name == 'viewname') { $variables['foo'] = 'bar'; } } 

I don't typically use the with the unformatted output, but I do it somewhat often at the field level.