How to hide an exposed filter block if the view results are empty? I have an exposed filter block on the sidebar on my page. I want to hide the exposed filter block if the result of the view is empty. What is the best was to do it ?
Right now i am having some Jquery code in a no result behaviour textfield wich hides some block elements. But i dont like this solution. I prefer if the code is clean and the html code is completely removed.
@pierre's answer is a good one, however $view->total_rows is not always populated.

So you could do something like this instead, which will work no matter what:

function MODULE_views_pre_render(&amp;$view) {
  if ($view-&gt;name == 'VIEW_NAME' &amp;&amp; $view-&gt;current_display == 'DISPLAY_NAME') {
    if (empty($view-&gt;result) &amp;&amp; empty($view-&gt;getExposedInput())) {
      $view-&gt;exposed_widgets = NULL;
    }
  }
}