Handlebars Use Cases
Simple Use Cases
Conditionally rendering content
#if
blocks can be used to control whether content is rendered.
Pluralizing Text
The formatMessage
helper can be used to pluralize text in rendered content. Pluralization respects the ICU format and entries follow Unicode CLDR rules.
Example
Setting Variables in the payload
Using a Handlebars block, you can transform and set a variable, which can then be used in a template
Designer | Preview |
---|---|
Using the intl block for localization
You can wrap Handlebars functions with the intl block in order to access internationalization features including currency, number formatting and dates. See Handlebars-intl for more information.