The ProductList-ATGCategoryChildren
cartridge displays the child products for the currently selected category on category pages.
Note: This cartridge should only be used on category pages. If you place it on a browse page, it will not render any content. See Category Pages versus Browse Pages for more details on the differences between the two page types.
Template
The XML template for the ProductList-ATGCategoryChildren
cartridge, located in <ATG10dir>/CommerceReferenceStore/Store/Storefront/deploy/cartridge_templates/MainContent-ProductList-ATGCategoryChildren.xml
, sets the cartridge’s content type to MainContent
and its ID to ProductList-ATGCategoryChildren
. The XML template defines one editable property, recordsPerPage
, that defines the number of child products to show for the current category.
Content Item and Handler
The atg.projects.store.assembler.cartridge.ProductListCategoryChildrenContentItem
class represents the content item that the ProductList-ATGCategoryChildren
cartridge returns to the renderer. The ProductListCategoryChildrenContentItem
class has three properties:
categoryId
: The ID of the current category.recordsPerPage
: The number of records to be displayed.totalNumRecs
: The total number of child products in the category.
Note that a ProductListCategoryChildrenContentItem
object does not contain the actual child products. It is the JSP renderer’s responsibility to retrieve the correct child products from the catalog repository based on the categoryId
returned in the content item.
The /atg/endeca/assembler/cartridge/handler/ProductListCategoryChildren
component, which is of class atg.projects.store.assembler.cartridge.handler.ProductListCategoryChildrenHandler
, is the cartridge handler responsible for creating and populating the ProductListCategoryChildrenContentItem
object. The ProductListCategoryChildrenHandler
class is an extension of the com.endeca.infront.cartridge.NavigationCartridgeHandler
class with an overridden process()
method. The process()
method retrieves the current navigation state from the /atg/endeca/assembler/cartridge/manager/NavigationState
component and creates a new ProductListCategoryChildrenContentItem
object. A call to the ProductListcategoryChildrenHandler.loadCategoryDetails()
method populates the ProductListCategoryChildrenContentItem
object with data from the catalog repository and returns it to the JSP renderer.
To do its tasks, the ProductListCategoryChildren
component has two configurable properties:
catalogTools
: This property specifies whichCatalogTools
component theProductListCategoryChildren
component should use to access product catalog data. Out of the box, this property is set to/atg/commerce/catalog/CatalogTools
.catalogNavigation
: This property references the/atg/store/catalog/CatalogNavigation
component, which is a Commerce Reference Store-specific component that retrieves the ID for the current category.
The ProductListCategoryChildren
component also inherits a number of properties from the /atg/endeca/assembler/cartridge/handler/NavigationCartridgeHandler
component, through a $basedOn
property configuration. Specifically, ProductListCategoryChildren
inherits a reference to the /atg/endeca/assembler/cartridge/manager/NavigationState
component that provides information on the shopper’s current navigation state.
JSP Renderer
The store.war/cartridges/ProductListCategoryChildren/ProductListCategoryChildren.jsp
page renders the content in the ProductListCategoryChildrenContentItem
object. This renderer retrieves the categoryId
value from the ProductListCategoryChildrenContentItem
object and uses this value as a parameter to the /atg/commerce/catalog/CategoryLookup
servlet bean to retrieve the category and its child products from the Catalog repository. The child products are then passed to the /atg/store/sort/RangeSortDroplet
servlet bean, along with the recordsPerPage
value returned in the content item, to sort and render the child product list.