Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have nodes with text and images in the body field. I wish to remove the images from the teaser texts, currently created with the "Summary or Trimmed" field display option.

Is there a hook or similar for altering the field before it's output in the teaser? Or would this require writing a custom field formatter?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

For Drupal 7, I have had good luck using the Smart Trim module.

Choose the Smart Trimmed field formatter and check the Strip Out HTML checkbox to remove the image tags (and other formatting that you probably don't want in a teaser text).

It also gives you some other handy formatting options (limit to number of words or characters, add "read more" links, etc) and makes the formatting options available for fields in Views, as well.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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