On my content type "page", I give my client the option to upload a sidebar image while editing the page fields. In the manage display of the content type, the image is hidden.

I have a view in the sidebar that shows the side bar images. I placed a contextual filter of Nid, and set it to provide a default value using the Content ID from URL, meaning that only the sidebar image for that page will be displayed.

This works sweet, but on pages where a sidebar image isnt uploaded, the sidebar is empty, but the views headers are there, and forcing the main content to be pushed to the left as if the sidebar region has content.

Reading other solutions, people have used a contextual filter of Global: Null, and set the view to hide if empty. But this isnt working for me, probably as I am already using a contextual filter to determine the content from the URL.

Other advice of setting the "no results behaviour" of the field doesnt do anything, the empty block still renders because it has nothing to do with fields, it is only printing the view headers.

I'm a bit stumped! Any ideas?


3 Answers 3


I found a very simple answer to this question.

The problem I was having was two contextual filters, Content:NID from URL, and Global:Null Hide If empty, which stopped the view displaying even if full.

Instead, I simply added a Filter Criteria for one of the fields in my view, with :fid on the end. In my case, it was Content: Sidebar Images:fid (not empty)

Now the view shows if it has content, and hides completely, including block region if empty.

  2. Select the same field that you are displaying under fields
  3. Select the Operator as "Is not empty(NOT NULL)"
  4. Save it, and it is done

For me, the problem was that I had a Global Text Area defined under Behavior when no results, from previous configurations. Got rid of that and the view stopped showing when it had no results.

(I work with Drupal in spanish so maybe the names in italic do not correspond to the actual english texts. Sorry for that)

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.