Tip of the week: formatting placeholders

Tip of the week: formatting placeholders

September 16, 2013
Tip of the week: formatting placeholders

You may be familiar with Liquid markup from our email notifications instructions. This templating language allows us to populate placeholders with the appropriate ticket information. Placeholders such as {{ticket.requester.first_name}} are converted into the appropriate text — “Bob”.

But what if the text generated from a placeholder doesn’t look quite right? Well, you can change the format of the output created from placeholders using Liquid markup! With a few simple tricks, you can truly customize your email notifications to fit your regional formatting and workflow needs.

Full documentation for Liquid is available at Liquid for Designers. Today we will focus on output markup and using filters to modify placeholder output. Output markup (such as our placeholders) is surrounded by matched pairs of braces, {{ticket.ticket_id}} for example. A filter is a simple method that acts on the output markup. The filters modify the output and the result is displayed as a string. The output and the markup are separated by a vertical bar, or “pipe” (|), and the overall format is {{output | filter: }}.

You can see all of the standard filters on the Liquid for Designers page. The latest tip of the week illustrates this concept, providing two real-world examples that use filters to modify a placeholder output.

Head to the forums to learn more

We know. It's a lot to take in.

Sign up for our newsletter and read at your own pace