How to control the length of dynamic text blocks

Some of the content in your email automations (especially product recommendations) is pulled dynamically from your product catalog. This saves you lots of time and effort, but since the product titles may vary greatly in length, may introduce email design issues such as an uneven number of rows.

There are 2 different "modifiers" you can use with smart tags within Remarkety to control the maximum (and minimum length) of length of dynamic text: "truncate" and "fixlen". The difference is that "truncate" will trim long strings but will not modify short strings, whereas "fixlen" will trim long strings and pad shorter strings with spaces so that you can be sure of the exact text length ahead of time. "truncate" will also take care to completely leave out the last word if it won't fit.

Both modifiers accept an optional parameter for the resulting string length. It's always a good idea to provide this and not rely on the defaults. The parameter is specified by adding ":<length>" to the modifier.

Example usage:

In this example, we are displaying the product recommendations' product title. The recommendation titles are always in {$r[0].title}, {$r[1].title}, etc. Let's assume that the product title in this case is 32 characters long: "This is an awesome product title"





"This is an awesome product title"

The original text


"This is an..."

Truncated to less than 20 chars because "awesome" wouldn't completely fit at the end


"This is an awesome..."

Truncated to 21 chars, including the additional "..." added at the end


"This is an awesom..."

fixlen doesn't mind partial words


"This is an awesome..."



"This is an awesome product title"

The string is less than 40 chars, so truncate does nothing


"This is an awesome product title        " The string was too short, so fixlen padded it with spaces
Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.