---
schema_version: "1"
id: 762aedb42bc9037cef0a654aa55f7d122611307bbf2c7f423a4d5ace047ada37
title: isslot Element
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/guides/isml/b2c-isslot.md
canonical_url: https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/b2c-isslot.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 58abc689750d1e3be087c0f90cbf43bf66711c97c8882d88c87b3eb3a7221e47
products:
  - Composable Storefront
  - Salesforce APIs
---
# isslot Element

Use a placeholder where content should appear.

## Syntax

```
<isslot
  id             = id                                 \\required
  context        = "global" | "category" | "folder"   \\required
  context-object = context-object                     \\required for category or folder context
  description    = description                        \\required
  preview-url    = url                                \\optional for category or folder context
>
```

- id = id

  - : _Allowed data type:_ string. Expressions aren't allowed.

    `id` identifies the slot in a slot configuration.

- context = "global" | "category" | "folder"

  - : Scope of the slot:

    - `global` sets the scope to every page on the site.
    - `category` corresponds to a specific category landing page.
    - `folder` corresponds to a specific content folder.

- context-object = context-object

  - : _Allowed data type:_ Expressions only.

    `context_object` is an expression that evaluates to a single category or folder object for category or folder scopes. For global scope, this can also evaluate to a single product object, a single basket object, or a collection (`dw.util.Collection`) of up to five products.

- description = description

  - : _Allowed data type:_ string. Expressions aren't allowed.

    `description` describes the slot for the business user who needs to configure it.

- preview-url = url

  - : `url` identifies the URL used within Business Manager to preview the content slot. It you don't specify a value, a default URL is used.

## Purpose

The `id` attribute is used by Business Manager to identify the slot in one or more slot configurations. The `context` attribute specifies the scope of the slot. The `context-object` attribute is required when the scope of the `context` attribute is either `category` or `folder`. The `context-object` attribute is used to lookup the slot configuration for the given slot. It is also used for [Einstein Product Recommendations (Trailhead)](https://trailhead.salesforce.com/content/learn/modules/cc-einstein-product-recommendations) and enables product recommendations based on a single product, a single category, a single folder, a single basket, or a collection of up to five products. Use the `description` attribute to describe the slot.

In Business Manager, slots are grouped by context scope. Global slots are grouped together, category slots are grouped together, and folder slots are grouped together.

For _Global_ slots, Business Manager shows the following values:

- Slot ID
- Description
- Number of slot configurations created

For _Category_ slots, Business Manager shows the following values:

- Category (assuming the category's configuration specifies a template that includes the `<isslot>` tag)
- Category name
- Rendering template name
- Slot ID
- Description
- Number of slot configurations created

For _Folder_ slots, Business Manager shows the following values:

- Folder ID (assuming the folder's configuration specifies a template that includes the `<isslot>` tag)
- Folder name
- Rendering template name
- Slot ID
- Description
- Number of slot configurations created

When no slot is defined in the database for a given slot ID, the `<isslot>` tag doesn't render any content. An entry is written to the log file to identify this occurrence.

## Examples

In this first example, the `<isslot>` tag references the homepage banner and specifies the _global_ context:

```
<isslot id="homepage_banner" description="Home banner 705px x 356px." context="global" />
```

In this next example, the `<isslot>` tag specifies the _category_ context:

```
<isslot id="category_top_featured" context="category" description="Category page top slot."
context-object="${pdict.ProductSearchResult.category}">
```

In this last example, the `<isslot>` tag specifies the _folder_ context:

```
<isslot id="fldr-landing-slotbanner" context="folder" description="Large Folder Landing Banner"
context-object="${pdict.ContentSearchResult.folder}"/>
```

## Using the Slotcontent Variable

The `slotcontent` variable is a TopLevel class system variable that provides access to the public class `dw.campaign.SlotContent`. This class provides access to slotting information. The following shows the mapping between the variable and the methods of this class:

| dw.campaign.SlotContent   | Template implicit objects |
| ------------------------- | ------------------------- |
| getContent() : Collection | slotcontent.content       |
| getSlotID() : String      | slotcontent.slotID        |
| getCallout() : MarkupText | slotcontent.callout       |
| getCustom() : Map         | slotcontent.custom        |

### Examples

In this first example, the rendering template shows products when the results of a slot execution returns a _product_ slot content type. The `slotcontent` variable is predefined in the `TopLevel.global` class and provides access to the SlotContent object. It's available only in ISML templates that are defined as a slot's template.

```
<isif condition="${!empty(slotcontent)}">
    <div class="product">
        <isloop iterator="${slotcontent.content}" alias="product">
            <isprint value="${product.SKU}"><br />
            <isprint value="${product.Name}"><br />
        </isloop>
    </div>
</isif>
```

In this next example, the template shows content assets when the results of a slot execution return a _content asset_ slot content type.

```
<isif condition="${!empty(slotcontent)}">
    <div class="assetlisting">
        <isloop iterator="${slotcontent.content}" alias="asset">
            <isif condition="${asset != null}">
                <div class="asset">
                    <div class="name">
                        <a href="${URLUtils.url('Page-Show','cid', asset.ID)}">
                            <isprint value="${asset.name}">
                        </a>
                    </div>
                </div>
            </isif>
        </isloop>
    </div>
</isif>
```

As this next example shows, you can also check if the `slotcontent` variable has anything in it at all, prior to pulling the information from it, as in the following example:

```
<isif condition="${slotcontent != null}">
<isloop items="${slotcontent.content}" var="contentAsset">
```

In this last example, the template shows products when the result of the Slot Execution returns `Slot Content Type = Product`.

```
<div class="product_1x2">
  <isloop iterator="${slotcontent.content}" alias="product" begin="0" end="1">
  <isset name="Product" value="${product}" scope="PDICT" />
  <div class="product_1x2_slot">
    <div class="image">
      <a title="${Resource.msg('components.common-details.001','components',null)}"  href="${URLUtils.http('Product-Show','pid', product.ID)}"><img src="${product.image.url}"
        alt="${Resource.msg​('components.image-thumbnail.001',​'components',null)}${product.name}" /></a>
    </div>
    <div class="productdetails">
      <h3><a title="${Resource.msg('components.common-details.001','components',null)}"  href="${URLUtils.http('Product-Show','pid', product.ID)}"><isprint value="${product.name}"></a></h3>
        <isinclude template="product/components/pricing">
    </div>
    <div class="clear"><!--  FLOAT CLEAR --></div>
    </div>
  </isloop>
    <div class="clear"><!--  FLOAT CLEAR --></div>
    </div>The following template shows content assets when the results of the Slot Execution returns Slot Content Type = Content Asset.
<iscontent type="text/html" charset="UTF-8" compact="true">

<!--- make sure we have an asset at all --->
<isif condition="${slotcontent != null}">
  <isloop iterator="${slotcontent.content}" alias="contentAsset">
    <isprint value="${contentAsset.custom.body}" encoding="off"/>
  </isloop>
</isif>
```
