Adding hypertext links for catalog views

In this tutorial lesson, you create hypertext links in the CachedHeaderDisplay.jsp file to display on the store header. The hypertext links use the URL references created in the previous step to switch between sales catalog views in the store.

Procedure

  1. Navigate to the following directory:
    • WC_eardir/Stores.war/Madisons/include/styles/style1
    • WebSphere Commerce Developer workspace_dir\Stores\WebContent\Madisons\include\styles\style1
  2. Open the header JSP file, CachedHeaderDisplay.jsp, for editing.
  3. Add the following text after the <div id="header"> tag in the JSP file:
    
    <a href='<c:out value="${IndexHolidayURL}"/>'><fmt:message key="Madisons_Holiday" bundle="${storeText}"/></a>
    <a href='<c:out value="${IndexSalesURL}"/>'><fmt:message key="Madisons_Sales" bundle="${storeText}"/></a>
    <a href='<c:out value="${IndexSpringFeverURL}"/>'><fmt:message key="Madisons_SpringFever" bundle="${storeText}"/></a>
    
  4. The <fmt:message> output text to display for Madisons_Holiday, Madisons_Sales, and Madisons_SpringFever. To add the text, you create the references in the stores resource bundle property file:
    1. Navigate to the following directory:
      • WC_eardir/Stores.war/WEB-INF/classes/Madisons
      • WebSphere Commerce Developer WCDE_installdir\workspace_dir\Stores\WebContent\WEB-INF\classes\Madisons
    2. Open the properties file storetext.properties for editing. If the file does not exist, create the file.
    3. Add the following lines:
      Madisons_Holiday=Holiday Catalog
      Madisons_Sales=Sales Catalog
      Madisons_SpringFever=Spring Fever Catalog 
      
  5. For locale-specific files, define the text for your locale.
    For example, en_US.
    1. Navigate to the following directory:
      • WC_eardir/Stores.war/WEB-INF/classes/Madisons
      • WebSphere Commerce Developer WCDE_installdir\workspace_dir\Stores\WebContent\WEB-INF\classes\Madisons
    2. Open the properties file storetext_en_US.properties for editing. If the file does not exist, create the file.
    3. Add the following lines:
      Madisons_Holiday=Holiday Catalog
      Madisons_Sales=Sales Catalog
      Madisons_SpringFever=Spring Fever Catalog 
      
    4. Repeat step 5 for each locale operational in your store.
  6. The hypertext links for your sales catalogs views are created. Open your store to test the hypertext links:
    1. Start WebSphere Commerce Developer.
    2. Start the WebSphere Commerce Test Server.
    3. Type the following URL into a web browser: http://localhost/webapp/wcs/stores/servlet/TopCategoriesDisplay?storeId=10001&catalogId=10001 Where 10001 is the storeId for your store and catalogId for your starter store master catalog.
    4. Click the hypertext links for each new sales catalog to view the new catalog view in your store.