Class ISML

This class provides support for rendering ISML templates. For more details about the ISML syntax, refer to the Commerce Cloud Digital developer documentation. Templates are stored as *.isml files. They are located in a locale-specific folder under the '/cartridge/templates' folder, with '/cartridge/template/default' being the default locale. The template name arguments of the various render methods represent the template path (without file ending) within this folder structure.

Example for rendering a template with arguments from JavaScript code:

Example code for accessing the template arguments in the 'helloworld.isml' template from the above code snippet:

This class does not have a constructor, so you cannot create it directly.

MethodDescription
static renderTemplate(String)Renders an ISML template and writes the output to the current response.
static renderTemplate(String, Object)Renders an ISML template and writes the output to the current response.
static renderTemplate(String)Renders an ISML template and writes the output to the current response.
static renderTemplate(String, Object)Renders an ISML template and writes the output to the current response.

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

static renderTemplate(template: String): void

Renders an ISML template and writes the output to the current response. The template may contain ISML tags which control the character encoding, content type, caching behavior and so on of the response (see ISML documentation).

Parameters:

  • template - the template path

API Version:

No longer available as of version 17.7. Puts template arguments into the global pipeline dictionary.


static renderTemplate(template: String, templateArgs: Object): void

Renders an ISML template and writes the output to the current response. The template may contain ISML tags which control the character encoding, content type, caching behavior and so on of the response (see ISML documentation). This method takes an additional JavaScript object as argument. Its properties are accessible for script expressions in the template under the "pdict.*" variable.

Parameters:

  • template - the template path
  • templateArgs - the template arguments object

API Version:

No longer available as of version 17.7. Puts template arguments into the global pipeline dictionary.


static renderTemplate(template: String): void

Renders an ISML template and writes the output to the current response. The template may contain ISML tags which control the character encoding, content type, caching behavior and so on of the response (see ISML documentation).

Parameters:

  • template - the template path

API Version:

Available from version 17.7. Keeps template arguments in a local pipeline dictionary scope. This avoids side-effects on other templates.


static renderTemplate(template: String, templateArgs: Object): void

Renders an ISML template and writes the output to the current response. The template may contain ISML tags which control the character encoding, content type, caching behavior and so on of the response (see ISML documentation). This method takes an additional JavaScript object as argument. Its properties are accessible for script expressions in the template under the "pdict.*" variable.

Parameters:

  • template - the template path
  • templateArgs - the template arguments object

API Version:

Available from version 17.7. Keeps template arguments in a local pipeline dictionary scope. This avoids side-effects on other templates.