1

I need to remove the images appears in the view in the field body. I have tried the following code.

.view-mydisplay .views-field-body {
    display:none;
}

However, I cannot see the image but the "maximum length of characters" of my field-body are not showing completely. If I remove the image manually in the body, then the characteres are complete in the view. Seems how if the image were counted like character.

For example if I have 300 max. characters in my view and I put an image only are showed 100 characters, after remove the images with css. If I don't put the image in my body, the view shows the 300 characters configured in the view.

2

The Smart trim module might be helpful. You'll be able to trim units by words or characters on stripped HTML.

After installing and enabling Smart Trim, you should see a "Smart trimmed" option in the format dropdown for your text fields. With smart trim, you have control over:

  1. The trim length
  2. Whether the trim length is measured in characters or words
  3. Appending an optional suffix at the trim point
  4. Displaying an optional "More" link immediately after the trimmed text
  5. Stripping out HTML tags from the field
| improve this answer | |
  • Hi, Thanks very much for your option. I don't want to affect the body of the node, only the view, I want if in the body of the node I put an image, this image not be showed in my view, however, when I remove the image with css the characters showed in my view are changed. For example if I have 300 max. characters in my view and I put an image only are showed 100 characters, after remove the images with css. Thanks very much for your help. – cabita Aug 23 '13 at 10:33
  • This module is integrated with Views. Please install this module and edit your view field which you're going to trim. Select formatter Smart trimmed. Trim units characters. Check strip html. All should work without any additional css settings. – Jack-PL Aug 23 '13 at 19:24

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.