1

I know that I can set default images for content types, but for my page, I would like to only display the default image for one particular view and not the other ones.

It would also be nice if the image is automatically displayed in the proper image style just like a regular image. Therefore it seems that I can't use "no results behavior" since there, I would have to specify the full html myself.

So can I somehow tell drupal 7 to use a default image for a view in case there is no image for an article such that it does not affect any other views?

1

2 Answers 2

2

Assuming you are working with the default Article content type of Drupal 7.x

enter image description here

You should add something similar to this in your NO RESULT BEHAVIOUR of your IMAGE field in your VIEWS

enter image description here

1
  • Yes, but the other image settings (image style, link image to, ...) are then then not applied to the default image, are they?
    – user51122
    Commented Dec 12, 2014 at 10:14
1

Add custom text in that particular view & fetch the image by using html code. Try this, this can 100% solve your query.

2
  • Could you elaborate on which html code to write? Via [field_news_images], I can fetch the image if there is one, but how would I provide the default value, such that the same style is applied?
    – user51122
    Commented Dec 12, 2014 at 12:51
  • 1
    @user51122 You apply the style manually in GIMP or whatever is your photo editor of choice. NishantP's answer is simple and elegant. You can also use Views to output the image as a link. Commented Dec 15, 2014 at 14:39

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.