Advanced Formatting Options for Description Templates

Article author
Store Automator
  • Updated

Format your descriptions by using HTML tags and handleBars Expressions.

Advanced Formatting Options for Description Templates:

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

 

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

 

Field Selector

 

Advanced Formatting for Description Templates

Field selector can be used to select and insert any predefined Dynamic fields from your inventory database. Click on the “Field Selector” textbox to use the 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:

 

Example usage of {{Product.Name}} field. If there were HTML tags in the “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 form the template as: {{Product.Name}} …(with 2 curly brackets), this field will be displayed with the HTML tags, such as:

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

 

To display this field without HTML tags and with proper HTML Formatting, use 3 curly Brackets. Call the field as {{{Product.Name}}} from the template:

"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 the other in the product description.

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

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

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

E.g.: if you want to print all bullet points one by one use this code below:

------------------------------------------------------------------

{{#each Product.Tags.BulletPoints}}

  • {{this}}

{{/each}}

-------------------------------------------------------------------

You can use this code snippet to display contents of all tags, Bullet Points, Other Attributes, Search Terms, Target Audience and Used For.

 

 

Calling Sub-Templates

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-template to the main template, with help of ">" sign in the front of template name.

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 sub-template.

>> Assign Description Templates to Channels

OR

>>Assign Title Templates to Channels

Was this article helpful?

0 out of 0 found this helpful