Главная » Web Development » Drupal » Drupal + PHP - How To Auto-Truncate Content At The End Of A Word

Drupal + PHP - How To Auto-Truncate Content At The End Of A Word

00:40

The problem:
Whilst working on an aggregation site recently I needed to find a way to truncate the length of aggregated posts so that they only showed the first 200 or so characters of the post. However, I also wanted the split point in the post to occur at the end of a whole word, as opposed to part way through a word, and add some visual indication that there was more still to read.

The solution:

More »