Cert++
Close

isinclude syntax for template and URL includes

Key Takeaway

<isinclude template="..."/> pulls another template into the page, which is a local include. <isinclude url="..."/> inserts the output of a separate request, which is a remote include. That request can have its own caching, so use a remote include to keep part of a cached page dynamic.

The <isinclude> tag in B2C Commerce ISML pulls content from another source into a template. You can then build a page from reusable pieces instead of repeating markup. A local include inserts another template file. A remote include runs a second pipeline as its own request and inserts what that request returns. Because that request can be cached on its own terms, a remote include can keep one part of a cached page dynamic.

Two kinds of include

<isinclude> includes content from an additional source in a template. The tag comes in two forms. Each <isinclude> uses either the template attribute or the url attribute, but not both.

Local includeRemote include
Attributetemplateurl
What it insertsThe content of another ISML templateWhat a second pipeline returns, reached by URL
How it runsPulled into the current templateAn additional request to the Application Server
<!-- Local include: insert another template -->
<isinclude template="components/footer/newsletterSignup"/>

<!-- Remote include: insert what a second request returns -->
<isinclude url="${URLUtils.url('Loyalty-PointsBadge')}"/>

The first tag pulls in a template by name. The second tag uses URLUtils.url to build the URL of a Loyalty-PointsBadge controller action. The output of that request goes into the page.

<isinclude> is allowed anywhere in a template. As a best practice, put includes that affect the whole page at the top of the template.

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.