Let's say you have a CCK Imagefield you'd like displayed in a sidebar instead of the main $content area of your page. You can check exclude under Display Fields for that content type, and then use Views to pull out the field and stick in a block display, but if your node does not contain an image, you may notice that a few empty <div> tags are returned, and your theme might not be too friendly in this case. Now you need to find some way to hide that view if the field is empty...
Why not try adding a filter to the View?
In this case I'm assuming you've used Views' Arguments to look for a "Node: Nid", and the "Node ID from URL" is selected as the option for "Provide default argument". Since you're on a node/[nid] page, there is a node returned, even if it has empty fields.
Under Filters, add a filter for the field (probably just one, to be safe) in question. Many fields will have an "is not empty (NULL)" option. This probably won't work for all field types.
Provided you have not filled in any empty text for your view, I think this takes care of it. Block views that have zero rows will not appear, but results with empty fields are still results.
Thanks for the tip... I struggled with this for several hours before finding this answer which worked like a charm.
Man, you are Genius! Thanks a lot!
Just what I was looking for. Thanks for help.
Nice trick, you saved me some time today!
You just saved my day. I was going around this issue for couple of hours not knowing why the hell views keeps rendering an empty block when it shouldn't create the block in the first place.
Adding the filter did the trick.