Need some help with your project? Contact me

Cool Module: Smart Trim

Today I’m going to talk a bit about a cool module I recently came upon called Smart Trimmed. This module adds a new formatting option to the Drupal 7 text fields. The option provides a more configurable trim setting for teasers and other view modes where you’d like a text field to be shortened automatically.

It’s actually not difficult to use. After installing it, you’ll notice that in the Display setting of your content types, for every Body field (or any other text, text_long, and text_with_summary field) you’ll get a new Format setting called Smart trimmed. So all you need to do is set and edit it on the view modes you’d like.

You get the following options: the length of the trim (both in words and in characters), a custom suffix you can attach at the end of the trimmed text, whether to display a Read more link if necessary (and what label should it have), what to do in case there is a Summary and whether to strip HTML tags from the text.

Now this is actually pretty cool. It gives you quite a lot of power if you need to create even sized text bodies in custom view modes or even the regular Teaser. Kudos for the maintainer new signature for coming up with this module.

So do check it out and drop some comments below if you need help.

Some related articles you might enjoy

Add new comment

You can post comments in Markdown and basic HTML tags.
For code blocks, wrap your code within '~~~'. For example:
~~~
$var = 'my variable';
~~~