1

I have created a view, which displays different content types. I have added some fields for dispalying (image, title, description). The issue for me is that not every node has an image. When it doesnt have the Drupal renders only title and description. How can I force adding image field for all nodes, even when it doesnt exist?

In my css I am using an :empty selector to add default background image.

3

In the view configuration settings for the Image field, there is a "No Results Behavior" section that allows html text input:

Views

You can add some html code like:

<img src="/sites/default/files/no-results.jpg" alt="Description"> 

to add an anchor image that only displays in the View if there are no Image files attached to the node field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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