How to hide a view if it has more than 1 row and also show some block if this is true? I have found a solution in "Hide a view if less than N results" for hiding the view by using the template.php file.

However I need to show a certain block also, the block is already in the correct region it would just need 'switching on' for this page.

Would it be possible to provide a callback inside the following code from the link posted above

function MY_THEME_NAME_preprocess_views_view(&amp;$vars) {
  if ($vars['display_id'] == 'MY_DISPLAY_ID' &amp;&amp; count($vars['view']-&gt;result) &lt; 1) {
    $vars['view']-&gt;result = NULL;
  }
}


To a function which turned the block on

Note: I am just starting module development.

edit: I'm now thinking that this would need to be done inside a custom module as it might be too late to turn the block on from the template.php file. If someone could clarify this.
Part 1

Enable the Rules block visibility module. Here is a quote from its project page:


  The Rules block visibility module allows Rules components to be used to control block visibility. This provides Drupal administrators and developers extreme flexibility in controlling when blocks should be displayed on their websites, in addition to the default visibility options provided by Drupal.
  
  The general idea is that if you can do it with Rules, you can use it to control block visibility, so the possibilities are limitless:
  
  
  Need to show a block only for users registered more than a month ago?
  Perhaps you have a block that must be shown only between 8am-5pm on weekdays?
  What about displaying or hiding a block based on current weather conditions?
  
  
  All of this can be done by using Rules block visibility.


For an illustration of how to use this module, refer to my answer to "How to stop a Views block from displaying to admins, such as user/1?".

Part 2

As per the "if you can do it with Rules, you can use it to control block visibility" above, you've reduced your question to making Rules "check the number of rows returned by your view" (so that the block is only shown if the view has more then 1 row).

For that, perform these steps:


Use the Views Bulk Operations module to create a variation of your view in which you add a VBO field to it.
Create a Rules Component with a Rules condition "Check number of results returned by a VBO view". And select the VBO view created in the previous step.