ISML

⚠️ The annual cost of maintaining the server where this website is hosted, the domain, and keeping it up-to-date is approximately €3,000 per year. Help us with a small donation to cover these expenses. Support Now!

0 / 10000 €

B2C Commerce ISML tags are extensions of the tag-based language conforming to SGML standards. They are commands inserted into a document that determine how B2C Commerce embeds live data into a page, and how to format this data together with the regular HTML code.

Each B2C Commerce tag has a specific name that always starts with the prefix "is," such as <isprint> or <isset>. Tags must be included within "< >", and can have several attributes that can be set to control the behavior of the tag. All tags and their attribute names are not case sensitive. However, the values of attributes are often case sensitive.

Tip: Salesforce recommends that you use lower-case as good programming practice.

The syntax shows literal values in quotes and variables without quotes. Unless otherwise noted, each attribute is included exactly once. You can only use expressions or strings as documented. Using expressions if they are not explicitly allowed causes exceptions.

Tag Syntax Purpose Location Notes
<isactivedatacontext>
<isactivedatacontext 
  category = current_category //req
/>

Active Data

Collects category context from a page for active data.

HEAD

BODY

Can be placed anywhere that script tags are valid.

Should only be in one template used to render a page.

 
<isactivedatahead>
<isactivedatahead/>

Active Data

Allows collection of active data from pages with a <head> tag.

HEAD  
<isanalyticsoff>
<isanalyticsoff/>

Analytics

Disables analytics for single pages.

HEAD

BODY

Can be placed anywhere that script tags are valid.

 
<isbuynow>
<isbuynow payment-request = SalesforcePaymentRequest expression  \\ req>
                           </isbuynow>

Commerce Cloud Payments

Injects <script> to render express checkout buttons that lets a shopper buy a specific product.

BODY

Can be placed anywhere script tags are valid.

 
<isbreak>
<isbreak/>

Flow control

Terminating loops

BODY Only used inside <isloop>...</isloop>
<iscache>
<iscache 
  status = "off" | "on" 
  type   = "relative" | "daily" //req
  hour   = duration_hr 
  minute = duration_min 
  varyby = "price_promotion"
/>

Caching

Caching storefront pages

Can be placed anywhere in the template.

However, as a best practice, Commerce Cloud recommends that caching statements are placed at the beginning of a template.

The tag can be located anywhere in the template. If the tag occurs several times in one template, the one set to cache off or the one with the shortest cache time is used as the cache setting for the resulting page.
<iscomment>
<iscomment> 
  ...
</iscomment>

Comments

Adding documentation for templates

Can be placed anywhere in the template. Using <iscomment> is preferable to using HTML comments, especially for sensitive information, because the tag is removed automatically by B2C Commerce on rendered pages. As a best practice, include an initial comment that describes the purpose, the requirements and the effect of a template from both a business point of view and a technical perspective.
<iscomponent>
<iscomponent
  pipeline   = pipeline_name //req
  locale     = locale_name 
  parameterN = valueN       //zero or more
/>

Include

Including the output of a pipeline in the page

Can be placed anywhere in the template.  
<iscontent>
<iscontent
  type     = MIME_type
  charset  = char_set;
  encoding = "on" | "off" | "html" | "xml" 
  | "wml"
  compact  = "true" | "false"
/>

HTTP

Define the MIME type of the output document

Before the HTML DOCTYPE declaration.

To make sure all characters in a document are correctly encoded, the <iscontent/> tag should always be first in an ISML template.

Don't specify <iscontent> if it isn't needed. The default for pipeline responses text/html, UTF-]8, and compact="false".
Note: The default for emails when using the SendMail pipelet is text/plain.
<iscontinue>
<iscontinue/>

Flow control

Jump to the beginning of the loop

BODY Only used inside <isloop>...</isloop>
<iscookie>
<iscookie
  name    = cookie_name //req
  value   = cookie_value //req
  comment = cookie_use
  domain  = domain_name
  path    = pathname
  maxAge  = cookie_lifetime
  version = cookie_spec
  secure  = "on" | "off"
/>

HTTP

Setting cookies in your system

Can be placed anywhere in the template.  
<isdecorate>
<isdecorate 
  template = template_name //req
>
  ...
</isdecorate>

Decoration

Template decoration mechanism

Must wrap all content to be decorated. For <isdecorate> to render a page, the content it wraps must contain an <isreplace/> tag.
<iselse>
<isif condition = if_expression>
  ...
 <iselseif condition = elseif_expression> 
    //0 or more
  ...
 </iselseif> 
 <iselse>
  ...
</isif>

Flow control

Specifying what happens if a condition doesn't evaluate to true

Can be placed anywhere in the template. Must be used with <ifelse>.
<isif>
<isif condition = if_expression>
  ...
 <iselseif condition = elseif_expression> 
   //0 or more
  ...
 </iselseif> 
 <iselse>
  ...
</isif>

Flow control

Creating conditional template code

Can be placed anywhere in the template.  
<iselseif>
<isif condition = if_expression>
  ...
 <iselseif condition = elseif_expression> 
   //0 or more
  ...
 <iselse>
  ...
</isif>

Flow control

Specifying a subcondition off an <isif> tag in a loop.

Can be placed anywhere in the template.  
<isinclude>
<isinclude 
  (template = template_name) 
    | (url = url_path) 
//req
/>

Include

Including the contents of one template inside another

Can be placed anywhere in the template.

However, as a best practice, add includes that affect the whole page to the top of the template.

 
<isloop>
<isloop
  (items = item_object ) 
    | (iterator = iter_object) 
     //req
  (alias = alias_name) | (var = var_name)
   status = <var name>
   begin  = <expression>
   end    = <expression>
   step   = <expression>>
  ...
</isloop>

Flow control

Creating loops

Can be placed anywhere in the template. See also isbreak, iscontinue, and isnext.
<ismodule>
<ismodule
  template  = template_path \\req
  name      = tag_name      \\req
  attribute = attr_name     \\req
/>

Include

Declaring custom tags

Can be placed anywhere in the template. In SiteGenesis, all <ismodules> are declared in one file: util/modules.isml.
<isnext>
<isnext/>

Flow control

Jumping forward within a loop

Can be placed anywhere in the template. Only used inside <isloop>...</isloop>
<isobject>
<isobject
  object =  name \\req
  view   = "none" | "searchhit" 
   |  "recommendation" | "setproduct" 
   | "detail" \\req
  ...
</isobject>

Active Data

Collects page impressions or views from the storefront.

Must wrap any object you want to record active data for. Must pass an object of type β€œProductHit”.
<ispayment>
<ispayment payment-request = SalesforcePaymentRequest expression  \\ req>
                           </ispayment>

Commerce Cloud Payments

Injects <script> to render express checkout buttons that lets a shopper pay for items in the current basket.

BODY

Can be placed anywhere script tags are valid.

 
<isprint>
<isprint
   value    = output \\req
  (style    = style_ID) 
    | (formatter = format) 
      \\style or formatter, but not both
   timezone = "SITE" | "INSTANCE" | "utc"
   padding  = padding_constant
   encoding = "on" | "off"
/>

Output

Formatting and encoding output strings

BODY  
<isredirect>
<isredirect
  location  = target_url  \\req
  permanent = "true" | "false"
>

HTTP

Redirecting browsers to specific URLs

Before the HTML DOCTYPE declaration.  
<isremove>
<isremove
  name  = var_name \\req
  scope = "session" | "pdict" 
   | "request" | "page"
>

Variables

Removing user-defined variables

Can be placed anywhere in the template.  
<isreplace>
<isreplace/>

Decoration

Part of the decorator mechanism; insert content to be decorated

Must be within <isdecorate> tags. If a template is going to be remotely included, the <isdecorate> tags can be in the including template.  
<isscript>
<isscript>
  ... 
</isscript>

Scripting

Creating scripts within templates

HEAD

BODY

Can be placed anywhere that script tags are valid.

 
<isselect>
<isselect
  name        = simple_name    \\req
  iterator    = loop_var       \\req
  description = box_text       \\req
  value       = text_value     \\req
  condition   = "true" | "false"
  encoding    = "on" | "off"
/>

Forms

Enhancements to the HTML<select> tag

Can be placed anywhere in the template.  
<isset>
<isset
  name  = var_name              \\req
  value = var_value             \\req
  scope = "session"|"request"
   |"page" \\req
/>

Variables

Setting user-defined variables

Can be placed anywhere in the template.  
<isslot>
<isslot
  id             = id             \\req
  context        = "global" 
    | "category" \\req
  context-object = context-object \\req
  description    = description    \\req
  preview-url    = url            \\req
>

Output

Define slots for content display

BODY

Usually within <isdecorate> tags.
 
<isstatus>
<isstatus
 value = http_code \\req
/>

HTTP

Define status codes

Can be placed anywhere in the template.