Toutes les collections
Newsletter
Template Editor
[Tutorial] Truncate the text on an article (depending on the number of characters)
[Tutorial] Truncate the text on an article (depending on the number of characters)

Limit the number of characters displayed in the title and description on an item to harmonize the overall design of a newsletter.

Benjamin Carro avatar
Écrit par Benjamin Carro
Updated over a week ago

Often, titles and descriptions have significant disparities in the number of characters.

To avoid having items with 6-line descriptions when others have only 3 lines (as in the image below), it is possible to cut the size of a text by indicating a maximum number of characters to display.

Thus the maximum space occupied by the articles of a newsletter will be the same and the design will be preserved.

To truncate a text according to the number of characters

  1. Select the block where text is to be cut off.

  2. The text editor appeared on the screen

  3. Select the metadata concerned by the truncation (in this example, it is the description) so we will select: {{ metadata.description }}.

4. Then, click on the "Truncate" button in the text editor.
5. A pop-up window opens automatically
6. Enter a value (note that this is a number of characters and not the number of words)
7. Validate the data entered in the pop-up window.
8. Click outside the text frame to preview the changes

The text is automatically cut off.

Good to know:

  • When a text is truncated, three suspension points are automatically added.

  • The system will never truncate in the middle of a word. If the size of the word exceeds the truncation limit by a few characters, then the whole word will be removed.

  • For the truncation to be applied, you must select the entire variable, e.g. {{metadata.description}}. In other words, even the square brackets must be selected, otherwise the text will not be truncated.

Delete the truncation parameter :

  1. Select the block you want to change

  2. The text editor has appeared on the screen and you see a pink text giving the number of letters (in this example: 130 letters).

3. Select the truncated metadata (by selecting it, the "Truncate" button turns pink).
4. Then click the "Truncate" button and the truncation is cancelled.

Avez-vous trouvé la réponse à votre question ?