Step 3: Adding hypertext links
In this step of the tutorial you will create hypertext links in the CachedHeaderDisplay.jsp file that display on the Consumer Direct starter store header. These hypertext links will work with the URL references you created in the previous step to show the new catalog views.
Follow these steps to add the necessary hypertext links to view your catalogs:
- Navigate to the following directory:
- WC_eardir/Stores.war/ConsumerDirect/include/styles/style1
- workspace_dir\Stores\Web Content\ConsumerDirect\include\styles\style1
- Open the header JSP file, CachedHeaderDisplay.jsp, for editing.
- Just after the last <tr> tag in the JSP file, copy and paste the following text:
<a href='<c:out value="${IndexHolidayURL}"/>'>Holiday</a> <a href='<c:out value="${IndexSalesURL}"/>'> Sales</a> <a href='<c:out value="${IndexSpringFeverURL}"/>'> Spring Fever</a>- The <c:out> for output of text for ConsumerDirect_Holiday 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:
- Navigate to the following directory:
- WC_eardir/Stores.war/WEB-INF/classes/ConsumerDirect
- WCDE_installdir\workspace_dir\Stores\Web Content\WEB-INF\classes\ConsumerDirect
- Create and open the properties file, infashiontext.properties, for editing if it does not already exist.
- Add the following lines:
ConsumerDirect_Holiday=Holiday Catalog ConsumerDirect_SpringFever=Spring Fever Catalog- For a locale-specific file, define your locale (for example, en_US).
- Create and open the properties file, infashiontext_en_US.properties, for editing if it does not already exist.
- Add the following lines: ConsumerDirect_Holiday=Holiday Catalog ConsumerDirect_SpringFever=Spring Fever Catalog
- Repeat the last step for each locale operational in your store
You have now added the necessary hypertext links to the Consumer Direct starter store to see your new catalog views.
To view the Consumer Direct starter store and see the changes you have made follow these steps:
- Start WebSphere Commerce Developer.
- Start the WebSphere Commerce Test Server.
- 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 starter store to 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 starter store.
(C) Copyright IBM Corporation 1996, 2006. All Rights Reserved.