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
- Navigate to the following directory:
- WC_eardir/Stores.war/Madisons/include/styles/style1
- workspace_dir\Stores\WebContent\Madisons\include\styles\style1
- Open the header JSP file, CachedHeaderDisplay.jsp, for editing.
- 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>
- The
<fmt:message>
output text to display forMadisons_Holiday
,Madisons_Sales
, andMadisons_SpringFever
. To add the text, you create the references in the stores resource bundle property file:- Navigate to the following directory:
- WC_eardir/Stores.war/WEB-INF/classes/Madisons
- WCDE_installdir\workspace_dir\Stores\WebContent\WEB-INF\classes\Madisons
- Open the properties file storetext.properties for editing. If the file does not exist, create the file.
- Add the following lines:
Madisons_Holiday=Holiday Catalog Madisons_Sales=Sales Catalog Madisons_SpringFever=Spring Fever Catalog
- Navigate to the following directory:
- For locale-specific files, define the text for your locale.
For example, en_US.
- Navigate to the following directory:
- WC_eardir/Stores.war/WEB-INF/classes/Madisons
- WCDE_installdir\workspace_dir\Stores\WebContent\WEB-INF\classes\Madisons
- Open the properties file storetext_en_US.properties for editing. If the file does not exist, create the file.
- Add the following lines:
Madisons_Holiday=Holiday Catalog Madisons_Sales=Sales Catalog Madisons_SpringFever=Spring Fever Catalog
- Repeat step 5 for each locale operational in your store.
- Navigate to the following directory:
- The hypertext links for your sales catalogs views are created.
Open your store to test the hypertext links:
- 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 Where
10001 is the
storeId
for your store andcatalogId
for your starter store master catalog. - Click the hypertext links for each new sales catalog to view the new catalog view in your store.