Q1: Use the shorten template operator. Example, {"This text is too long"|shorten(4)} produces "This..."
Q2: Either you use the shorten operator again if you have a hyperlink with a text description. Or you can use the autolink operator to detect URLs in a text and make them clickable that way. The autolink operator also takes one (optional) parameter: max characters.
Thank you for your quick reply! I've got a small problem. Now I use the following code for showing the full description: {$category.item.data_map.description.data_text}
When I change this into: {$category.item.data_map.description.data_text|shorten(15, "... read more")}
nothing is showed. Source says:
<div class="date">
<?... read more
<BR /><BR /> </div>
The code:
{"This one works just fine!"|shorten(15, "... read more")} works fine. Do you know what's wrong with my first string?
Does your data_text contain anything (debug output).. You do know that if it is an xml text field begning with some formating (15+ chars) then nothing will show.. Only some hidden html tags cause there referces are not there.
You're asking to shorten the pure XML, you should use the shorten operator on the HTML:
{$category.item.data_map.description.content|shorten(15)} for regular text fields. Or {$category.item.data_map.description.content.output.output_text|shorten(15)} for XML text fields.