Skip to main content
All CollectionsE-mailsDesign of an emailPersonalize an email
Liquid: set a maximum number of characters
Liquid: set a maximum number of characters

Are your product descriptions very long and you don't want to show it in full in an email? Use liquid to set a maximum number of characters.

Francine avatar
Written by Francine
Updated over 10 months ago

The truncate function allows you to set a limit on the number of characters. It can happen that the product title or description of one product is many times longer than another product. With truncate you can limit this.

With the liquidation below, the product name is truncated after 10 characters:

{{ product.name | truncate: 10 }}

With this setting, the product name is truncated, and three dots ( ... ) are added. It is possible to change these three dots to your own inspiration:

{{ product.name | truncate: 10, " etc." }}

In this case, it will show "etc." (note the space before the word). Want to show nothing at all after the product name abbreviation? You can do that, too:

{{ product.name | truncate: 10, "" }}

Did this answer your question?