Skip to content

Handlebars

Ross Morsali edited this page May 22, 2022 · 11 revisions

The initial idea of this plugin was only to output to Handlebars templates.

This allows for rendering in a range of environments that do not support JavaScript rendering natively.

Adding helpers

Handlebars doesn't come with out of the box support for conditions such as equals and not equals which are only required if you are using control type variables.

This plugin uses the following helpers for control variable expressions:

  • if_truthy
  • if_falsy
  • if_equal
  • if_not_equal

These should be added as custom helpers to your handlebars implementation.

An implementation of these helpers using the Handlebars PHP package is provided here.

Known handlebars implementations

  • PHP - available via github and maintained by Salesforce
  • Ruby - available via github and maintained by Smart Bear
  • Java - available via github and maintained by jknack

Let us know if there are any missing.

Using a custom language

Since we released the initial "in-development" version, support has been added for the PHP language and custom languages - this means it's no longer necessary to install handlebars on your server with PHP.

You could use a custom language to achieve the same in other environments too, which should remove the handlebars dependency and improve performance and rendering on your server.