Show no result on first load in views

If you want your result list to be empty the first time you load the view, but if you press Apply when filters are set to Any, you want all to be shown, then you can configure it like this.

Add Argument: Global NULL
Mark: Provide default argument
Mark: PHP Code
PHP argument code:

<?php
if (count($view->exposed_input)) {
   return
FALSE;
}
?>
Do not use <?php ?> 

Validator: Basic validation
Action to take if argument does not validate: Display empty text

Scoure: http://drupal.org/node/358546#comment-1492012

This even work with Organic Groups as an argument.

 

Knowledge keywords: