Remove/Hide the block if the View is empty? Is there any API to know if the block is empty? Basically what I'm trying to do is to hide/unset the block inside template_preprocess_page. 

Here is my currrent code:

 if ($variables['page']['rail_full']) {
    foreach ($variables['page']['rail_full'] as $keys =&gt; $blocks) {
      if (isset($blocks['content']['#views_contextual_links_info'])) {
        $name = (isset($blocks['content']['#views_contextual_links_info']['views_ui'])) ? $blocks['content']['#views_contextual_links_info']['views_ui']['view']-&gt;name : '';
        $display_id = explode('-', $blocks['#block']-&gt;delta);
        $block = views_get_view_result($name, $display_id[1]);
        if (empty($block)) {
          unset($variables['page']['rail_full'][$keys]);
        } 
      }
    }
  }


But the above code always return a count of 1 when I print $block.

The below works fine but not a good solution. I want it to be dynamic in all block as possible.

if (!isset($variables['node']-&gt;field_author_favorite_links['en'])) {
    unset($variables['page']['rail_full']['views_franchise_page-block_2']);
}

if (!isset($variables['node']-&gt;field_article_column['en'])) {
    unset($variables['page']['rail_full']['views_franchise_page-block_3']);
}
I had the same behavior with "empty" fields. Unless you don't hide the fields themselves, the design/ markup still renders.
Solution for me was to filter for fields being "NOT NULL".
(Maybe it depends on the "fences"-module i have installed, too. Not sure, because not tested ...)