Four JSP renderers are included in the store.war/cartridges/ directory, to render the content returned by the ScrollablePromotionalContent-ATGSlot, ScrollableProductSpotlight-ATGSlot , ScrollablePromotionalContent-ATGTargeter, and ScrollableProductSpotlight-ATGTargeter cartridges:

The first two renderers, ScrollablePromotionalContent-ATGSlot.jsp and ScrollableProductSpotlight-ATGSlot.jsp, are used to render the Default Home Page. The other two renderers are not used out of the box but are provided to support the ScrollablePromotionalContent-ATGTargeter and ScrollableProductSpotlight-ATGTargeter cartridges.

ScrollablePromotionalContent-ATGSlot.jsp

The ScrollablePromotionalContent-ATGSlot.jsp page renders the promotional content items that are returned by the ScrollablePromotionalContent-ATGSlot cartridge.

The page uses a forEach loop to render all of the promotional content items returned by the cartridge; however, only one image is shown on the page at any given time. The other images are hidden from view until they are accessed via scrolling functionality, specifically:

The scrolling functionality is incorporated through a custom Dojo widget. The widget’s dojotype is atg.store.widget.ScrollablePromotionalContent. The JavaScript code that supports the widget is found in store.war/javascript/widget/ScrollablePromotionalContent.js and the HTML markup for the widget <div> is found in store.war/javascript/widget/template/scrollablePromotionalContent.html. To make the ScrollablePromotionalContent.js source available to Commerce Reference Store pages, the following script include tag is added to store.war/includes/pageStartScript.js:

<script type="text/javascript" src="${javascriptRoot}/widget/ScrollablePromotionalContent.js"></script>

The ScrollablePromotionalContent-ATGSlot.jsp initializes the ScrollablePromotionalContent widget with a set of input parameters, shown below.

Parameter

Type

Description

Default

id

String

Unique identifier for the ScrollablePromotionalContent widget. This allows the JSP to identify and scroll the correct widget when the shopper clicks a scrolling control.

None

totalItems

Number

The number of promotional content items contained in the content item returned by the ScrollablePromotionalContent-ATGSlot cartridge.

None

style

String

The style set on the widget span. This value is set to none to prevent the widget from displaying until it is fully initialized and ready to render. After the widget has been fully initialized, the ScrollablePromotionalContent.js script overrides the style setting and allows the widget to display.

None

Note: The ScrollablePromotionalContent widget does not use the siteContextPath, previousLinkTitle, and nextLinkTitle parameters shown in the ScrollablePromotionalContent-ATGSlot.jsp.

The ScrollablePromotionalContent-ATGTargeter.jsp page functions identically to the ScrollablePromotionalContent-ATGSlot.jsp page. Because the /atg/endeca/assembler/cartridge/renderer/ContentItemToRendererPath component maps cartridges to their renderers by comparing names, the ScrollablePromotionalContent-ATGSlot and ScrollablePromotionalContent-ATGTargeter cartridges each have their own renderers. See the ATG-Endeca Integration Guide for more details on the ContentItemToRendererPath component.

ScrollableProductSpotlight-ATGSlot.jsp

The ScrollableProductSpotlight-ATGSlot.jsp page renders the set of featured products that is returned by the ScrollableProductSpotlight-ATGSlot cartridge. This page functions very similarly to the ScrollablePromotionalContent-ATGSlot.jsp page. It uses a forEach loop to render all of the products returned by the cartridge; however, only a specified number of products are shown at any given time (out of the box, this value is set to 5). The other products are accessed via the following scrolling functionality:

When the previous or next arrow is clicked, the carousel scrolls to the next page of products. When a product is clicked, the product detail page for that particular product is rendered.

This illustration is described in the surrounding text.

Again, like the ScrollablePromotionalContent-ATGSlot.jsp page, the scrolling functionality for ScrollableProductSpotlight-ATGSlot.jsp is incorporated through a custom Dojo widget. The widget’s dojotype is atg.store.widget.ScrollableProductSpotlight. The JavaScript code that supports the widget is found in store.war/javascript/widget/ ScrollableProductSpotlight.js and the HTML markup for the widget <div> is found in store.war/javascript/widget/template/ ScrollableProductSpotlight.html. To make the ScrollableProductSpotlight.js source available to Commerce Reference Store pages, the following script include tag is added to store.war/includes/pageStartScript.js:

<script type="text/javascript" src="${javascriptRoot}/widget/ ScrollableProductSpotlight.js"></script>

The ScrollableProductSpotlight-ATGSlot.jsp initializes the ScrollableProductSpotlight widget with a set of input parameters, shown below.

Parameter

Type

Description

Default

id

String

Unique identifier for the ScrollableProductSpotlight widget. This allows the JSP to identify and scroll the correct widget when the shopper clicks a scrolling control.

None

pageSize

Number

The number of products to render per page.

None

totalProducts

Number

The total number of products contained in the content item returned by the ScrollableProductSpotlight-ATGSlot cartridge.

None

style

String

In the JSP, this parameter is set to none to prevent the widget from displaying until it is fully initialized and ready to render. After the widget has been fully initialized, the ScrollableProductSpotlight.js script overrides the style parameter and allows the widget to display.

None

Note: The ScrollableProductSpotlight widget does not use the previousLinkTitle and nextLinkTitle parameters shown in the ScrollableProductSpotlight-ATGSlot.jsp.

The ScrollableProductSpotlight-ATGTargeter.jsp page functions identically to the ScrollableProductSpotlight-ATGSlot.jsp page. Because the /atg/endeca/assembler/cartridge/renderer/ContentItemToRendererPath component maps cartridges to their renderers by comparing names, the ScrollableProductSpotlight-ATGSlot and ScrollableProductSpotlight-ATGTargeter cartridges each have their own renderers. See the ATG-Endeca Integration Guide for more details on the ContentItemToRendererPath component.


Copyright © 1997, 2014 Oracle and/or its affiliates. All rights reserved. Legal Notices