资 源 简 介
The smartshort template operator shortens input strings like the shorten template operator but with a few important differences - most of the time it will break at the end of a sentence and it will not break html tags.
The problem with the default shorten template operator is that it"s a substring of the input, so it will break wherever it will land... including in the middle of a word. Another problem is that if the input is an xml block with tags those
could end in the middle of a html tag and mess up the layout of the rest of the page. Or, with a long tag - which wouldn"t be visible but would count in the total for the sub string - would make the visible string too short.
Since practically all of our customers want minimal html tags in their line views (see the strip_except template operator) - and want their line views
to all be shortened - it has always been problematic and up until now we"ve only been able to allow self-closing tags or the content editors had