2022.1

Table Of Contents
To register a partial, use the following function in a script: Handlebars.registerPartial
('partialName', 'template') (for details see: "Handlebars API" on page460).
For example, this line of code registers a template (clauses.hbs) as a partial with the name
'clauses':
Handlebars.registerPartial('clauses', 'snippets/partials/clauses.hbs');
Tip
Partials registered in a Control Script will be available in all standard scripts. Control
Scripts are executed first. (See "Control Scripts" on page425.)
Note
Registering multiple partials with a single call is not supported in OLConnect.
Using partials in Handlebars templates
To include a partial in a Handlebars template, insert an expression that refers to it, for example:
{{> partialname.hbs}}.
Relative paths (starting with snippets/) and arbitrary URLs (starting with file:// or http:// or https://)
are supported.
The file name can be:
l the name of an .hbs snippet in the template (for example:{{> snippets/Snippet
1.hbs}}
l the name of an .hbs snippet on disk (starting with file:///)
l the name of a remote .hbs snippet (starting with http:// or https://)
With a snippet on disk, the complete syntax is:file://<host>/<path>. If the host is"localhost", it
can be omitted, resulting infile:///<path> - note the three forward slashes after file:.
In the remainder of the path you can either use escaped backward slashes:
"file:///C:\\Users\\Administrator\\Desktop\\Handlebars_LoadFile.hbs"
or forward slashes:
"file:///C:/Users/Administrator/Desktop/Handlebars_LoadFile.hbs"
Page 458