2022.1

Table Of Contents
Handlebars is the name of a JavaScript library that implements a templating language (see
https://handlebarsjs.com/). It uses a template and an input object to generate output.
Handlebars templates look like regular text with embedded Handlebars expressions. A
handlebars expression is a {{, some contents, followed by a }}. For example:
<p>Hello {{firstname}} {{lastname}}!</p>
When the template is rendered, these expressions are replaced with values from an input
object.
The Handlebars library is integrated in OL Connect Designer. This means that you can use
Handlebars expressions in this special type of snippets.
Working with Handlebars templates involves scripting. If you are new to scripting in the
Designer, first read:"Writing your own scripts" on page918.
Note
The information in this Online Help focuses on the implementation of Handlebars in OL
Connect. For general information about Handlebars and how to use it, see the following
web sites: https://handlebarsjs.com/ and https://devdocs.io/handlebars.
Creating a Handlebars template
To create a new, empty Handlebars template:
1. On the Resources pane, right-click the Snippets folder and select New Snippet.
2. Select the type of snippet that you want to create: Handlebars template.
3. Give the snippet a name.
4. Double-click the new file to open it in the Designer and fill it with HTML text and
Handlebars expressions.
The editor for Handlebars snippets does not have a Design view. HTML with Handlebars
expressions is not necessarily valid HTML. Processing it with an HTML parser might break
both the Handlebars expressions and the HTML.
More about expressions and the functions that you can use in them can be found in the topic:
"Handlebars expressions" on page979.
Page 782