Cert++
Close

Server-side isscript blocks and SFRA page asset registration

Key Takeaway

All <isscript> blocks in one ISML template share one execution context, so a variable declared in one block works in later blocks and in ${ } expressions. In SFRA, the recommended use of <isscript> is to register a page's client-side JavaScript and CSS through the assets module.

An <isscript> block runs server-side script inside an ISML template. ${ } expressions let you use script values inline in the page or inside tag attributes. In SFRA, the recommended use of <isscript> is narrow. Each page template uses it to register its client-side JavaScript and CSS files through the assets module, while business logic stays in controllers and models.

Server-side script in a template

An <isscript> ... </isscript> block holds server-side script inside an ISML template. You can put the block in <head>, in <body>, or anywhere a script tag is valid.

Four top-level variables are available inside an <isscript> block:

VariableWhat it is
sessionThe current session (dw.system.Session)
requestThe current request (dw.system.Request)
pdictThe Pipeline Dictionary (dw.system.PipelineDictionary)
outA PrintWriter for the HTML page
B2C Commerce Developer Study Guide

Checklist progress

0/237Learned

Given a development task, code ISML templates that use functionality, such as local include, remote include, components, and other ISML tags

0/14

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other B2C Commerce Developer studiers. 796 members and growing.