Skip to main content
3 of 3
added 6 characters in body
M a m a D
  • 3.8k
  • 2
  • 32
  • 62

In your comment you said : Currently, it is configured to use the URL of a page to determine the theme that page will take so by this assumption:

Use hook_preprocess_views_view as follow and suggest your theme

function YOURTHEME_OR_MODULE_preprocess_views_view(&$vars) {
$path = current_path();
$view = $vars['view'];
switch ($view->name) {

case 'SOME_VIEW_NAME' :
  if($path == "SOME_PATH1_OR_PATTERN1")
       $vars['theme_suggestion'][] = 'views_view__custom_blocks';

  if($path == "SOME_PATH2_OR_PATTERN2")
       $vars['theme_suggestion'][] = 'views_view__ANOTHER_custom_blocks';
break;

case 'ANOTHER_VIEW_NAME' :
  ;
break;

}
}

If the first condition get satisfied create file views-view--custom-blocks.tpl.php and theme your view.

you can also use hook_preprocess_views_view_fields to set the values of the variables of the view.

M a m a D
  • 3.8k
  • 2
  • 32
  • 62