isslot Element

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 are not 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 an expression that evaluates to a category or folder object.

description = description

Allowed data type: string. Expressions are not 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

<isslot> can be used as a placeholder for where the content should appear. 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. 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:

For Category slots, Business Manager shows the following values:

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 does not 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 lets you access 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>