Cert++
Close

Output encoding with isprint and iscontent

Key Takeaway

A ${} expression written directly in a text/html template is HTML encoded automatically. A template pulled in with <isinclude template=""> that sets no content type of its own is treated as text/plain, so its ${} output isn't HTML encoded. Use <isprint>, which encodes by default.

ISML templates print dynamic data, such as product names and search phrases, into storefront pages. That data must be encoded so special characters such as < or quote marks can't be used for cross-site scripting (XSS). The <iscontent> tag sets a template's content type, which decides whether ${} expressions written directly in the markup are HTML encoded automatically. The <isprint> tag formats a value and encodes it explicitly. The <isprint> tag can also target a specific encoding context or turn encoding off.

Why output encoding matters

Encoding all content shown on a page is how a B2C Commerce site blocks XSS attacks that work through content manipulation.

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.