Tutorials > Customize > Create views for multiple catalogs in a store

< Previous


Add hypertext links

In this step of the tutorial we will create hypertext links in the CachedHeaderDisplay.jsp file that display on the store header. These hypertext links will work with the URL references you created in the previous step to show the new catalog views.


Procedure

  1. Navigate to the following directory:

    • WC_EAR/Stores.war/ConsumerDirect/include/styles/style1

    • workspace_dir\Stores\Web Content\ConsumerDirect\include\styles\style1

  2. Open the header JSP file, CachedHeaderDisplay.jsp, for editing.

  3. Just after the last <tr> tag in the JSP file, copy and paste the following text:

    <a href='<c:out
    value="${IndexHolidayURL}"/>'><fmt:message
    key="ConsumerDirect_Holiday" bundle="${storeText}"/></a>
    <a href='<c:out
    value="${IndexSalesURL}"/>'><fmt:message
    key="ConsumerDirect_Sales" bundle="${storeText}"/></a>
    <a href='<c:out
    value="${IndexSpringFeverURL}"/>'><fmt:message
    key="ConsumerDirect_SpringFever"
    bundle="${storeText}"/></a>
    

  4. The <fmt:message> for output of text for ConsumerDirect_Holiday, ConsumerDirect_Sales and ConsumerDirect_SpringFever are new references added to the stores resource bundle property file.

    To add text to your properties files, do the following steps:

    1. Navigate to the following directory:

    2. Create and open the properties file, storetext.properties, for editing if it does not already exist.

    3. Add the following lines:

      ConsumerDirect_Holiday=Holiday Catalog
      ConsumerDirect_Sales=Sales Catalog
      ConsumerDirect_SpringFever=Spring Fever Catalog 
      

    4. For a locale-specific file, define the locale (for example, en_US).

    5. Create and open the properties file, storetext_en_US.properties, for editing if it does not already exist.

    6. Add the following lines:

      ConsumerDirect_Holiday=Holiday Catalog
      ConsumerDirect_Sales=Sales Catalog
      ConsumerDirect_SpringFever=Spring Fever Catalog
      

    7. Repeat the last step for each locale operational in your store.

You have now added the necessary hypertext links to the consumer direct sample storeto see the new catalog views.

To view the store and see the changes you have made follow these steps:

  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


Summary

In this tutorial you learned that you can create new sales catalogs, and entry items for those sales catalogs, through the WebSphere Commerce Accelerator. In the second step you learned that create URL references on the page where you want the catalogs to be accessible from. In order to do that you edited the CachedHeaderDisplay.jsp file for the consumer direct sample storeto setup links in the header. Finally in the third step you learned that it is also necessary to create hypertext links that use the URL references you created. The hypertext links you created put text links to your new sales catalog views on the header of the consumer direct sample store.

< Previous


+

Search Tips   |   Advanced Search