I'm using Views Field to show a view in a Horizontal Tab in a content type. My trouble is that when the view returns empty based on filter criteria, the tab is not hidden.

The view itself has 4 fields from the content plus some custom text.

I tried going through some of the "Not Empty" tips for hding blocks when views are empty, but It didn't work and it was all a shot in the dark anyway.

1 Answer 1


Try with this

$node = node_load($argument);
if ((isset($node->field_fotos) || 
     isset($node->field_summary)) &&
     (is_array($node->field_fotos) &&
     count($node->field_fotos) > 0) ||
     (is_array($node->field_summary) && 
     count($node->field_summary) > 0)) {
  return TRUE;
else {
  return FALSE;
  • Where would I try that? In the view or in the page template? Also I'm assuming field_fotos and field_summary would be replaced by my particular fields. Commented Nov 22, 2015 at 1:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.