Developer forum

Forum » Templates » Get first x characters of paragraph text

Get first x characters of paragraph text

Dmitrij Jazel
Reply
Hello DW,

I was wondering if it is possible to control the range of the text information like here:
(take a look at the attachment)

It tells it has 123 Chars. Is there a possibility to "read first 50 chars" from this tag?

Kind regards,
Dmitrij
123Chars.png

Replies

 
Marco Johannesen
Reply
If you limit in the paragraph, where would you show the full paragraph?

You could achieve it easily with jQuery though...
See this example: http://jsfiddle.net/bMhgK/

 
Morten Bengtson
Reply
If you want to avoid outputting the complete text, you can use the substring function in an XSLT template.
If you are not comfortable with XSLT you can hide some of the text by using jQuery (or plain javascript) substring function as mentioned or use CSS text-overflow depending on what end result you are looking for :)

 

You must be logged in to post in the forum