Whitespace placed before any symbol inside the handlebars will cause an error. Correct: {{expression}}{{dateFormat}} Incorrect: {{ expression}}{{ dateFormat}} // note the leading whitespace Error: {{expression {{field}} // second set of opening braces seen as new expression
Tag: Celigo Handlebars
Handlebars custom helper – replace
Replaces all the occurrences of the specified letter in a string with another letter. Ex: Template – {{replace cases “&” “and”}} Context – {“cases”: “these & those & some other cases”} Output – these and those and some other cases Ex: Template – {{replace $item[*].price “,” “”}} Context – 12,500 Output – 12500
How to add a handlebar inside a handlebar
Use a bracket to separate the handlebars. Please check the following for an example {{#if line_items.0.properties.0.value }}{{#contains line_items.0.properties.0.value “Pre Order”}} {{dateFormat ‘MM/DD/YYYY’ (replace line_items.0.properties.0.value “Pre Order | Due In ” ”) ‘DD/MM/YYYY’}}{{/contains}}{{/if}}