Code: Select all
{content block='meta_description' wysiwyg='false' assign='meta_description'}
<meta name="description" content="{$meta_description|strip_tags|summarize:30:""}">
and just incase you user tries to get smart with formatting, all tags are stripped
following that, the output is trimmed to 30 words, just incase the user types in way too much stuff.
Enhancements to this would be to create a smarty modifier that detected sentences, and trimmed it to two sentences, but that's not necessary at this time.
This tip also describes how to capture the contents of a content block into a smarty variable for processing, and how to combine smarty modifiers to accomplish various effects.