![]() The Handlebars feature was introduced after researching templates of various customer projects (mainly policy documents). The following shows how to apply common formatter helpers like: upperCase, currency: These helpers are based on the Formatter object as found in the OL Connect Designer’s scripting API (upperCase, lowerCase, currency, currencyNoSymbol, grouped etc). OL Connect adds various built-in data formatting helpers to the Handlebars implementation. Formatting data using OL Connect’s Formatter helpers The following example loops over the rows in the clauses detail table and inserts the values of the label and desc fields. Inside the block simply refer to the data fields by name. The each block helper can be used to iterate over an array (this could be detail table) in order to repeat a block of HTML code for each entry. The Handlebars library also supports loops. To be, or not to be, that is the question. ExpressionsĪ Handlebars expression is basically a variable wrapped with double curly braces, for example: How to use this feature with your sections and possible limitations will be covered in a separate article. ![]() It is good to understand that the implementation is not limited to snippets. Note! This article focusses on using Handlebars snippets, which is the primary use case of this feature. As these tasks are driven/initiated from the snippet there is no need to create user scripts in the OL Connect template. Typically, these are placeholders for data fields, but these expressions can also apply simple logic using helpers such as if statements, each loops and more. There are many online resources that provide you with valuable information.Ī Handlebars snippet (also referred to as ‘template’) is essentially HTML mixed with special tags called expressions. It is a popular templating library that provides a simple way to merge HTML snippets with data. ![]() With having a background in web design one could be familiar with Handlebarsjs. ![]() The article shows how to utilize Handlebars snippets by creating segments of a simplified insurance policy document. This article is an introduction to the Handlebars implementation in OL Connect Designer 2022.1 (this version is set for release by the end of May 2022). The Handlebars snippets in OL Connect Designer 2022.1 will vastly reduce the number of scripts for these documents and will help to keep templates lean by creating semantic snippets. But even then, things can become cluttered and may even impact the overall performance of your template. There is a requirement for the snippets and scripts to be thoughtfully organized (grouping, naming conventions, search optimizations). Snippet heavy templates can become hard to maintain when each snippet is accompanied by multiple scripts to apply personalization and conditions. Snippets can be stored in the template or fetched from a remote system like a Content Management System (CMS). A snippet is a small, ready-to-use piece of content that often contains one or more placeholders for data. If you’ve created OL Connect Designer templates for long documents like contracts and insurance policies before you’re undoubtedly familiar with snippets. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |