There are multiple places in the mobile application where lists of products are displayed in a slider.

Page

Slider(s)

Notes

Home Page

Promotions slider (top slider)

Object Type: atg.adapter.gsa.GSAItem

Rendered in: homePagePromotionalCell.jsp

Created in: promo.js

Promotion’s products slider (bottom slider)

Rendered in: horizontal-list.js

Created in: horizontal-list.js

Product Details Page

Related Items slider

Object Type: atg.adapter.gsa.GSAItem

Rendered in: relatedProducts.jsp

Created in: products.js - initRelatedItemsSlider()

Recently Viewed Items slider

Object Type: atg.adapter.gsa.GSAItem

Rendered in: recentlyViewed.jsp

Created in: cart.js - initRecentlyViewedItemsSliderPanel()

Empty Cart Page

Featured Items slider

Object Type: java.util.HashMap$Entry

Rendered in: emptyCart.jsp

Created in: cart.js - initFeaturedItemsSliderPanel()

Recently Viewed Items slider

Object Type: atg.adapter.gsa.GSAItem

Rendered in: recentlyViewed.jsp

Created in: cart.js - initRecentlyViewedItemsSliderPanel()

Category Landing Page

Featured Items slider

Object Type: com.endeca.infront.cartridge.model.Record

Rendered in: HorizontalRecordSpotlight.jsp

Created in: global.js - initHorizontalListSlider()

Brand Landing Page

Featured Items slider

Object Type: com.endeca.infront.cartridge.model.Record

Rendered in: HorizontalResultsList.jsp

Created in: global.js - initHorizontalListSlider()

productsHorizontalList.jsp

The productsHorizontalList.jsp extracts product information and adds it to the slider in the correct format, by itinerating over the list of products provided to it based on the object type.

This JSP also helps centralize and encapsulate the logic behind displaying products in a slider, which helps remove unneeded code, simplifies the jsps, and makes them more readable.

parameters

productsHorizontalList.jsp expects the following input parameters:

Parameters

Description

Required

products

This parameter contains a list of any of the product objects. The page will then process the objects and display them based on their type, either GSAItem or Endeca record.

Yes

index

Specifies the index of the slider on the page. This is needed only when there is more than one slider on the page. In that case where there is only one slider on the page, the including page can leave out this parameter and it will be defaulted to one.

No

Any page that needed to show a slider would include productsHorizontalList.jsp and specify these parameters. For example:

<dsp:include page="${mobileStorePrefix}/global/gadgets/productsHorizontalList.jsp">
  <dsp:param name="products" value="${contentItem.records}" />
</dsp:include>

To adapt to this centralized approach, the following pages include productsHorizontalList.jsp:

Note: relatedProducts.jsp has been removed as it is no longer used.

Supporting JavaScript code

A single JS function:

(initHorizontalListSlider())

is used for creating the sliders in the app, except for the home page sliders.


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