Forum Discussion
Hi Keith, as you discovered, the "?truncate" syntax is for Apache FreeMarker, while email templates utilize Apache Velocity 1.5. In the Marketo community thread, they referred to a couple of variables:
- $String: They were using this to refer to a StringUtils object.
- $display: They were using this to refer to a DisplayTool object (from Velocity Tools)
Using utilities/tools like these would require that they have been placed on the context by the environment (the community application). Unfortunately Khoros does not provide access to these or other utilities.
So you would need to find a way to do this yourself using conditional logic and the methods provided on the String itself. Here is the source code for those two utilities, which you could try to emulate:
Broadly, any implementation would need to use the "length" method (to determine whether to truncate) and then conditionally use the "substring" method, plus some concatenation.
Related Content
- 5 years ago
- 4 years ago