Last Updated on May 21, 2019

Advanced Formatting Options for Description Templates:

Advanced formatting can be utilized while working in code view mode; to switch to code view click on </> button located on the formatting toolbar. Clicking on this button will toggle your screen between code view and normal view.

Codeview mode will allow you to use all predefined HTML tags and handleBars Expressions.

Field Selector
advanced formatting templates

Field selector can be used to select and insert any predefined Dynamic fields from your inventory database. Click on “Field Selector” textbox to use Autofill feature and the system will provide a long list of predefined fields identified in the database that can be matched with the intended Target field. Click on “Insert” to insert the field into the text box. Make a note that inserted fields will be in double curly brackets:

e.g.: {{Product.Name}}

If there were HTML tags in “Product.Name” text body you have to use 3 curly Brackets before and after the field name, to display the data in the field correctly. This is a function of handlebars language that the system is utilizing.

E.g.: the field Product.Name reads as:

This product is good for especially <b> children</b> and their….

<b> and </b> are HTML tags and if the field was called as:  {{Product.Name}} …(with 2 curly brackets), this field will be displayed with the HTML tags, such as:

Result:

This product is good for especially <b> children</b> and their…

In order to display this field without HTML tags and with proper HTML Formatting use 3 curly Brackets. Call the field as: {{{Product.Name}}}

Result:

This product is good for especially Children and their…

If expression
Usage: {{#if condition}} {{else}} {{/if}}

e.g.: You want to assign and print a shipping price to product descriptions with a rule. The rule is if the product has free shipping, then print “free shipping for this item” if not print the product shipping fee in the descriptions. The following code does the described work:

{{#if Product.IsFreeShipping}} Free Shipping for this item. {{else}} {{#if Product.ShipPrice}} Just ${{Product.ShipPrice}} for shipping. {{else}} {{/if}} {{/if}}

each expression

Usage: {{#each condition}} {{/each}}

E.g.: You want to render multiple product images one after each other in the product description.

{{each Product.ImageUrls}} {{/each}}

The result is it will print multiple image URLs one after each other.

Make a note, there are no curly brackets at Product.Image, outside curly brackets, are the correct syntax.

SubTemplate

You can create new templates for specific work. For instance, you created a separate template for calculating shipping price, you can call this template as a sub to the main template.

Usage: {{>sample-desc-sub-temp-shipping}}

Make sure to create the sub template with the correct name before calling the main template. Failure to do so will result in error messages pointing out the missing subtemplate.

>> Assigning Description Templates to Channels