--- title: "Using the Truncate Filter in Liquid Markup" slug: "using-the-truncate-filter-in-liquid-markup" status: "new" updated: 2026-07-21T20:18:20Z published: 2026-07-21T20:18:20Z canonical: "knowledge.technolutions.net/using-the-truncate-filter-in-liquid-markup" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://knowledge.technolutions.net/llms.txt > Use this file to discover all available pages before exploring further. # Using the Truncate Filter in Liquid Markup Use the `truncate` [Liquid filter](/v1/docs/liquid-markup-filters) when a merge field or export may return more characters than you want to display. The filter shortens the value to a specified character count and can optionally append an ending string. > [!TIP] > ⭐ Get Inspired > > This article was adapted from [a post by Technolutions staff](https://community.technolutions.net/get-inspired/post/using-truncate-in-liquid-markup-h5Bw0429EMCD3bx) in the Slate Community Forums' Get Inspired space. Have a great idea for a Get Inspired post? [Let us know](https://community.technolutions.net/get-inspired/new?post_type=gnHx7As1gZ8r6Ld)! ## Shorten a value with the default ellipsis Add `| truncate:` followed by the maximum number of characters. ```plaintext {{ academic_major | truncate: 8 }} ``` If `academic_major` returns `journalism`, this outputs: ```plaintext journ... ``` The ellipsis is included in the character count. In this example, the output contains five characters from the original value plus the three-character ellipsis. ## Shorten a value without an ellipsis Add a blank string as the second argument when you want the output to stop at the character limit without adding an ellipsis. ```plaintext {{ academic_major | truncate: 8, "" }} ``` If `academic_major` returns `journalism`, this outputs: ```plaintext journali ``` ## Use a custom ending Add a custom string as the second argument when the shortened value should end with custom text. ```plaintext {{ academic_major | truncate: 21, ", and so on" }} ``` If `academic_major` returns `social anthropology`, this outputs: ```plaintext social ant, and so on ``` > [!WARNING] > 📝 Note > > The custom ending counts toward the total character limit. If the custom ending is longer than the limit, increase the limit or use a shorter ending. ## Where to use truncate The `truncate` filter is useful in places where Liquid markup can render dynamic values, including mailings, portals, and other content that supports Liquid markup. If you need to shorten values directly in a query result, consider using a query formula instead. ## Related articles - [Liquid Markup Filters](https://knowledge.technolutions.net/docs/en/liquid-markup-filters) - [The For Tag and Liquid Looping](https://knowledge.technolutions.net/docs/en/liquid-markup-looping)