Skip to content

Instantly share code, notes, and snippets.

@pustynnykh
Created August 27, 2014 11:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pustynnykh/517a5d20cfe8588e776f to your computer and use it in GitHub Desktop.
Save pustynnykh/517a5d20cfe8588e776f to your computer and use it in GitHub Desktop.
Drupal new theme suggestion for block system main with view. Put it to template.php
function theme_preprocess_block(&$vars) {
$block = $vars['block'];
if($block->module == 'system' && $block->delta == 'main' && function_exists('views_get_page_view') && views_get_page_view()){
$view_object = views_get_page_view();
$vars['theme_hook_suggestions'][] = 'block__views__' . $view_object->name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment