Developers
Template helpers
Handlebars is logic-less on purpose. Anything conditional arrives pre-computed in your data, or is one of these.
| Helper | Example | Result |
|---|---|---|
| money | {{money total}} or {{money total "USD"}} | R 21 160,00 |
| number | {{number quantity 2}} | 1 234,50 |
| date | {{date issueDate}} or {{date issueDate "short"}} | 12 September 2026 / 12/09/2026 |
| datetime | {{datetime at}} | 12 Sept 2026, 10:12 |
| inc | {{inc @index}} | 1-based numbering |
| eq, ne, gt, gte, lt, lte | {{#if (gt total 1000)}}…{{/if}} | comparisons |
| and, or, not | {{#if (and paid sent)}} | boolean logic |
| upper, lower, truncate | {{truncate description 40}} | text |
| default | {{default reference invoiceNumber}} | first non-empty value |
| sum, multiply, add, subtract, percent | {{money (sum lineItems "total")}} | arithmetic |
| join, initials, padStart | {{padStart number 6}} | 000418 |
| asset | <img src="{{asset 'logo.png'}}"> | an image stored with the version |
| json | {{json metadata}} | debugging |
The render context
Your data at the root. pages and pageCount when paginating. content, shared and allContent from the template's static copy: when the payload carries a variant that matches a top-level key of content, that block is content and the shared block is shared. meta with documentId, correlationId, templateSlug, templateVersion, generatedAt and generatedAtDisplay.