I have a search result view of different content types, and i want to show the body field (trimmed) on some content types, but show no body on other content types. Since they all share the same body field, I would need to exclude the body field from displaying on the content types that I don't want to see them on.
Right now I am doing this with Views rewrite results and CSS. I add the content type field and exclude, then add the body field. Under rewrite results I rewrite the output of the body field with this:
I then hide the content type bodies that I don't want to see with CSS:
This works "visually", but the class and the trimmed body are still rendered in the HTML. Is there a better way to do this perhaps with a
(I am completely inexperienced with PHP.)