JavaScript and Dynamic Data
The Template editor provides an HTML and a CSS tab but no JavaScript one. You can still use JavaScript though!
To use JS in your Templates, you can open a script
tag and start working.
HTML
Accessing the Document payload
To make using JavaScript in your Template more powerful, you can access your Document payload as a JavaScript object.
Start by enabling JavaScript injection for your Template in its Settings tab:
Let's say you defined your payload as follows:
JSON
You can now access the payload data this way:
HTML
Related articles
Debugging your JavaScriptLast updated