How to Use Truncate in Post List Content ?

Hi,

Truncate filter not working in post list content

I saw this example:

"I only want to show the first sentence. Not the second."|truncate(40) }} 
{{ "I only want to show the first sentence. Not the second."|truncate(35, True, '..........') }}

This is work fine for content directly filtered but it is not in case of Post List Content

we tried these all but not working

{{ post.post_list_content|safe|truncate(35, True, '..........') }}{{ post.post_list_content|truncate(35, True, '..........') }}

can we have any other filter to restrict words in hubl or how to use this truncate filter?

Thanks.

Hi Venkateshwar,

Here I found one solutuion,please try it below

use striptags to remove html tags.

{{ post.post_list_content|striptags|truncate(35, True, '..........') }}

Thank you

Working
16x16_smiley-very-happy.png.png
Thank you Jerin ..