How to use token in fields using Display Suite module?

1.4k Views Asked by At

I have the following code using Fields in display suite module:

<?php
$words = '[node:body]';
echo implode(" ",array_splice($words,0,60));
?>

But this does not work. My purpose here is to trimmed the content to 60 words for use in teaser. Because currently, display suite don't have the option to limit the number of words using Plain Text.

The problem with Trimmed is it does not removed the html formatting.

1

There are 1 best solutions below

0
On

You Could use the smart trim module to achieve that http://drupal.org/project/smart_trim