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

< Previous | Next >


Create URL references

In this step of the tutorial we will add URL references to the store in order to load new views for the catalog you created in the previous step.

To enable switching between sales catalogs within the same store implementation, URL references within the store need to be updated. This tutorial will update the CachedHeaderDisplay.jsp to allow for multiple sales catalogs.

When using JSTL, we will use the c:url reference tag. The c:url tag can include a number of parameters to make up a URL request that can be properly formatted to send to the WebSphere Commerce Server. The c:url tag's value will be the URL command name TopCategoriesDisplay. The identifier that is passed into this URL command will actually be the value you specified earlier for each Sales Catalog 'code', that is why it was important to make sure to type the code exactly as written in the tutorial in the previous step.

The following three codes specify the three catalogs you created:

Follow these steps to create URL references to the new catalog views:


Procedure

  1. Navigate to...

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

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

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

  3. Just before the first <tr> tag, copy and paste the following text:

    <c:url var="IndexSalesURL" 
           value="TopCategoriesDisplay">
    
        <c:param name="langId" value="${langId}" />
        <c:param name="storeId" value="${WCParam.storeId}" />
        <c:param name="identifier" value="ConsumerDirectSalesMain" />
    
    </c:url>
    
    <c:url var="IndexHolidayURL" value="TopCategoriesDisplay">
        <c:param name="langId" value="${langId}" />
        <c:param name="storeId" value="${WCParam.storeId}" />
        <c:param name="identifier" value="ConsumerDirectSalesHoliday" />
    </c:url>
    
    <c:url var="IndexSpringFeverURL" 
           value="TopCategoriesDisplay">
    
        <c:param name="langId" value="${langId}" />
        <c:param name="storeId" value="${WCParam.storeId}" />
        <c:param name="identifier" value="ConsumerDirectSalesSpringFever" />
    
    </c:url>
    

  4. Save and close CachedHeaderDisplay.jsp

You have now created the URL references necessary to link your new catalog views to the consumer direct sample store. Each of the references goes to the same view (TopCategoriesDisplay), but will use a different catalog in that view.

In the next step of the tutorial we will create the hypertext links that show up on the consumer direct sample store header so that users can view the catalogs.

< Previous | Next >


+

Search Tips   |   Advanced Search