0

I have a node type with an image field and insert button to get the image into the text field.

Then there is a view that is getting the content of the text field and shortening it to 150 characters. But if there is an inline image at the beginning of the text the view is only showing three points that are linked to the image.

How can I exclude the inline images from views?

1 Answer 1

2

You could use the Rewrite results option on that field and choose Strip HTML tags.

This will "remove" the image from display.

If you have some other HTML inside the Body that you want to keep you can enter them into the Preserve certain tags field, for example <em> <span> <p>.

2
  • Ok, this was almost too easy :D, thank you!
    – 0711master
    May 24, 2019 at 16:19
  • One aspect to consider, though, is if media managed images placed inline in the text field are used. Even if HTML is stripped, there can be some text from the image such as picture, that's output in the plain text. For that reason, outputting HTML and using display: none; in SCSS/CSS to target media elements may be desirable.
    – karolus
    Dec 12, 2020 at 2:29

Your Answer

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

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