CMS Development

VictoriaR
Mitglied

Limit text to display on blog listing page

lösung

I believe there is a custom html/css way to set how many characters appear in the blog description. Please let me know how I can limit the descriptions to 200 characters. Thanks!

0 Upvotes
1 Akzeptierte Lösung
jzilch
Lösung
HubSpot Employee
HubSpot Employee

Limit text to display on blog listing page

lösung

To adjusted to 200 characters you can adjust the first paramter from 28 to 200. 

 

{{ html_text|truncatehtml(200, '..' , false) }}

This filter takes three paramters which I have listed below. 

 

1. Amount of characters to display for the user

2. The elipsis to display after the specificed number of characters in the first paramter

3. Whether words will be broken at length

Lösung in ursprünglichem Beitrag anzeigen

4 Antworten
jzilch
HubSpot Employee
HubSpot Employee

Limit text to display on blog listing page

lösung

Hi, 

 

I believe you're looking for truncatehtml found here. https://designers.hubspot.com/docs/hubl/hubl-supported-filters. 

 

This will give you something like the following

{{ html_text|truncatehtml(28, '..' , false) }}
0 Upvotes
VictoriaR
Mitglied

Limit text to display on blog listing page

lösung

Does this limit to 200 characters or do I add that in the".."

0 Upvotes
jzilch
Lösung
HubSpot Employee
HubSpot Employee

Limit text to display on blog listing page

lösung

To adjusted to 200 characters you can adjust the first paramter from 28 to 200. 

 

{{ html_text|truncatehtml(200, '..' , false) }}

This filter takes three paramters which I have listed below. 

 

1. Amount of characters to display for the user

2. The elipsis to display after the specificed number of characters in the first paramter

3. Whether words will be broken at length

VictoriaR
Mitglied

Limit text to display on blog listing page

lösung

Thank you 🙂

0 Upvotes