The Liquid Syntax
Last updated March 23, 2026
Liquid is an open-source template language created by Shopify. It provides a clean and simple syntax you can use to write PDFMonkey templates and make them highly dynamic.
How PDFMonkey uses Liquid
Liquid v4
5.0.0 or above in the official Liquid documentation will not be available in PDFMonkey.When you write a Template using code, the HTML you write is actually using Liquid. This means that you can insert dynamic data, transform this data, condition the content of your template or loop over lists to repeat some content.
A taste of Liquid
Here’s a quick example that shows what a Liquid template looks like in PDFMonkey. It uses most of the key features you’ll encounter:
<h1>Invoice #{{invoiceNumber}}</h1>
<p>Date: {{"now" | date: "%B %d, %Y"}}</p>
<p>Client: {{client.fullName}}</p>
<table>
<tr>
<th>Product</th>
<th>Qty</th>
<th>Price</th>
</tr>
{% for item in lineItems %}
<tr>
<td>{{item.product}}</td>
<td>{{item.quantity}}</td>
<td>{{item.price | times: item.quantity | with_delimiter, precision: 2}}</td>
</tr>
{% endfor %}
</table>
{% if client.isNewClient %}
<p>Welcome aboard! Enjoy 10% off your next order.</p>
{% endif %}
In this short snippet you can see the three building blocks you’ll use everywhere:
- Output tags
{{ }}— insert dynamic values into the HTML. They can access nested properties likeclient.fullName. - Logic tags
{% %}— control flow with conditions (if/else), loops (for), and more. - Filters
|— transform values inline. Heredateformats the current date,timesmultiplies two numbers, andwith_delimiterformats the result with commas and decimals.
Each of these is covered in depth in the pages below.
Conditions and loops
Conditions (if, unless, case) and loops (for) let you control what appears in your output. You can show content only when certain criteria are met, or repeat a block for every item in a list.
Filters
Liquid filters let you transform data inside your templates. You pipe a value through one or more filters using the | character to format strings, manipulate numbers, work with arrays, and more.
Liquid provides many built-in filters (data transformation helpers) that will be enough in most cases. That said, authoring many templates ourselves, we’ve discovered the need for some additional ones that we added along the way.
PDFMonkey supports all standard Liquid filters plus a set of custom filters tailored to document generation:
- Filters — the complete reference including built-in Liquid filters and PDFMonkey-specific filters like
barcode,entities,in_time_zone, and more
Tags and helpers
In the same spirit, we also extend the default set of features Liquid brings to the table to offer features that might only make sense within PDFMonkey.
- Reusing Code (Snippets and Partials)
Complete Liquid documentation
Frequently asked questions
- What templating language does PDFMonkey use?
- PDFMonkey code templates use Liquid v4, an open-source template language created by Shopify. It provides output tags {{ }} for inserting values, logic tags {% %} for conditionals and loops, and filters for transforming data.
- Can I use Liquid v5 features in PDFMonkey?
- No. PDFMonkey runs Liquid v4. Any feature marked as 5.0.0 or above in the official Liquid documentation is not available in PDFMonkey templates.
- Does the PDFMonkey Builder use Liquid?
- No. Liquid is only used in Code Templates. Builder templates use Vue under the hood. If you want Liquid syntax like {% if %} or Liquid filters, use a Code Template instead.