ISML
Velocity
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
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:
1let isml = require('dw/template/ISML');
2isml.renderTemplate('helloworld', {
3 Message: 'Hello, World!'
4});Example code for accessing the template arguments in the ‘helloworld.isml’ template from the above code snippet:
1The message is: <isprint value="${pdict.Message}" />This class does not have a constructor, so you cannot create it directly.
| Method | Description |
|---|---|
| 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
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:
API Version:
No longer available as of version 17.7. Puts template arguments into the global pipeline dictionary.
Note
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:
API Version:
No longer available as of version 17.7. Puts template arguments into the global pipeline dictionary.
Note
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:
API Version:
Available from version 17.7. Keeps template arguments in a local pipeline dictionary scope. This avoids side-effects on other templates.
Note
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:
API Version:
Available from version 17.7. Keeps template arguments in a local pipeline dictionary scope. This avoids side-effects on other templates.
Note