ISML

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 angle brackets (< and >), 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.

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

Tip

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

Tag & LocationSyntax & Notes

<isactivedatacontext>

Allowed locations:

  • <head>
  • <body>
  • Anywhere that script tags are valid.
<isactivedatacontext
  category = current_category //req
/>

Collects category context from a page for active data.

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

<isactivedatahead>

Allowed location:

  • <head>
<isactivedatahead/>

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

<isanalyticsoff>

Allowed locations:

  • <head>
  • <body>
  • Anywhere that script tags are valid.
<isanalyticsoff/>

Disables analytics for single pages.

<isbuynow>

Allowed locations:

  • <body>
  • Anywhere that script tags are valid.
<isbuynow payment-request = SalesforcePaymentRequest expression \\ req>
</isbuynow>

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

<isbreak>

Allowed locations:

  • <body>
<isbreak/>

Only used inside <isloop> for terminating loops.

<iscache>

Allowed location:

  • Anywhere in the template
<iscache
  status = "off" | "on"
  type = "relative" | "daily"     //req
  hour = duration_hr
  minute = duration_min
  varyby = "price_promotion"
/>

Cache a page.

The tag can be located anywhere in the template. However, we recommend that caching statements are placed at the beginning of a 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>

Allowed location:

  • Anywhere in the template
<iscomment>
  ...
</iscomment>

Add documentation to the template.

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.

Using <iscomment> is preferable to using HTML comments, especially for sensitive information, because the tag is removed automatically by B2C Commerce on rendered pages.

<iscomponent>

Allowed location:

  • Anywhere in the template
<iscomponent
  pipeline = pipeline_name        //req
  locale = locale_name
  parameterN = valueN             //zero or more
/>

Include the output of a pipeline in the page.

<iscontent>

Allowed location:

  • Before the DOCTYPE declaration
<iscontent
  type = MIME_type
  charset = char_set;
  encoding = "on" | "off" | "html" | "xml"
   | "wml"
  compact = "true" | "false"
/>

Define the MIME type of the output document.

Don't specify <iscontent> if it isn't needed. The default for pipeline responses is text/html, UTF-8, and compact="false".

The default for emails when using the SendMail pipelet is text/plain.

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

<iscontinue>

Allowed location:

  • <body>
<iscontinue/>

Jump to the beginning of the loop.

Only used inside <isloop>.

<iscookie>

Allowed location:

  • Anywhere in the template
<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"
/>

Set a cookie.

<isdecorate>

Allowed location:

  • Must wrap all content to be decorated.
<isdecorate
  template = template_name        //req
>
  ...
</isdecorate>

Template decoration mechanism.

For <isdecorate> to render a page, the content it wraps must contain an <isreplace/> tag.

<iselse>

Allowed location:

  • Anywhere in the template
<isif condition = if_expression>
  ...
<iselseif condition = elseif_expression>
  //0 or more
  ...
</iselseif>
<iselse>
  ...
</isif>

Specify what happens if a condition doesn't evaluate to true.

Must be used with <ifelse>.

<isif>

Allowed location:

  • Anywhere in the template
<isif condition = if_expression>
  ...
<iselseif condition = elseif_expression>
  //0 or more
  ...
</iselseif>
<iselse>
  ...
</isif>

Create conditional template code.

<iselseif>

Allowed location:

  • Anywhere in the template
<isif condition = if_expression>
  ...
<iselseif condition = elseif_expression>
  //0 or more
  ...
<iselse>
  ...
</isif>

Specify a subcondition for an <isif> tag in a loop.

<isinclude>

Allowed location:

  • Anywhere in the template
<isinclude
  (template = template_name)
   | (url = url_path)
//req
/>

Includes the contents of one template inside another.

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

<isloop>

Allowed location:

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

Creates a loop.

See also <isbreak>, <iscontinue>, and <isnext>.

<ismodule>

Allowed location:

  • Anywhere in the template
<ismodule
  template = template_path        \\req
  name = tag_name                 \\req
  attribute = attr_name           \\req
/>

Declares custom tags.

In SiteGenesis, all <ismodules> are declared in one file: util/modules.isml.

<isnext>

Allowed location:

  • Anywhere in the template
<isnext/>

Jump forward within a loop.

Only used inside <isloop>.

<isobject>

<isobject
  object = name                   \\req
  view = "none" | "searchhit"
   | "recommendation" | "setproduct"
   | "detail" \\req
  ...
</isobject>

Collects page impressions or views from the storefront.

Must pass an object of type ProductHit.

Must wrap any object you want to record active data for.

<ispayment>

Allowed locations:

  • <body>
  • Anywhere that script tags are valid
<ispayment
  payment-request = SalesforcePaymentRequest expression \\ req>
</ispayment>

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

<isprint>

Allowed location:

  • <body>
<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"
/>

Format and encode output strings.

<isredirect>

Allowed location:

  • Before the DOCTYPE declaration
<isredirect
  location = target_url           \\req
  permanent = "true" | "false"
>

Redirect to a target URL.

<isremove>

Allowed location:

  • Anywhere in the template
<isremove
  name = var_name                 \\req
  scope = "session" | "pdict"
   | "request" | "page"
>

Remove user-defined variables.

<isreplace>

Allowed location:

  • Must be within <isdecorate> tags
<isreplace/>

The insert content to be decorated.

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

<isscript>

Allowed locations:

  • <head>
  • <body>
  • Anywhere that script tags are valid
<isscript>
  ...
</isscript>

Create a script within a template.

<isselect>

Allowed location:

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

Enhancements to the HTML <select> tag.

<isset>

Allowed location:

  • Anywhere in the template
<isset
  name = var_name                 \\req
  value = var_value               \\req
  scope = "session"|"request"
   |"page"                        \\req
/>

Set user-defined variables.

<isslot>

Allowed location:

  • <body>
  • Usually within <isdecorate> tags
<isslot
  id = id \\req
  context = "global"
    | "category"                  \\req
  context-object = context-object \\req
  description = description       \\req
  preview-url = url               \\req
>

Define slots for content display.

<isstatus>

Allowed location:

  • Anywhere in the template
<isstatus
  value = http_code               \\req
/>

Define a status code.

See also:

Parent topic: