Truncate Parser
The Truncate Parser allows you to limit the length of text by cutting off excess characters and adding an ellipsis. This is useful when you need to display long text in a limited space.
Usage
To use the parser, insert the following syntax in your text:
{truncate(maxlength):variable}
- You can also reference this parser using the aliases: ml, maxLength
Examples
- Basic truncation:
- Input:
{truncate(13):This is a very long text}
- Output:
This is a ver...
- Using with variables:
- Input:
{truncate(7):{member.name}}
- Output:
NotDemo...
Notes
- If the text is shorter than the maxlength, it will be returned unchanged
- When text is truncated, an ellipsis (…) is automatically added to the end
- The max length parameter must be a positive integer
- Spaces count towards the character limit