JSP code snippet: Store catalog display
This JSP code snippet displays all available catalogs (master catalog and sales catalogs) associated with a store. It uses the StoreDataBean to retrieve all the CatalogDataBeans that contain the catalog information.
The StoreCatalogDisplay.jsp file is available under the following directory:
- WC_INSTALL/samples/Snippets/web/Catalog\SalesCatalog
- WCDE_INSTALL\samples\Snippets\web\Catalog\SalesCatalog
Prerequisites
- Your store must have at least one master catalog and one sales catalog.
- The properties file used by this snippet is WCDE_INSTALL /samples/Snippets/properties/Catalog/CatalogJSPCodeSnippetText.properties.
- Copy this file (StoreCatalogDisplay.jsp) to the directory WCDE_INSTALL/workspace/Stores/Web Content/ store/include.
You may want to copy the properties to the proper location for the store, for example, WCDE_INSTALL /workspace/Stores/Web Content/WEB_INF/classes/ storedir or merge it with the own properties files.
Usage
- Add the following line to the jsp file to which to add this snippet: <c:import url="${jspStoreDir}include/StoreCatalogDisplay.jsp" />
Use ConsumerDirect as an example, you can add the above c:import statement into WCDE_INSTALL/workspace/Stores/Web Content/ConsumerDirect/include/styles/style1/CachedSidebarDisplay.jsp if you are using style1.
- In the code, uncomment the section marked by [Data Bean Activation].
Related concepts
Related information
Tutorial: Customizing the consumer direct sample store using snippets