Tutorials > Management Center > Track and displaying the most viewed recipes

< Previous | Next >


Create an e-Marketing Spot in the storefront to display the most viewed recipes

In this lesson, you modify existing JSP files for displaying the recipes in the storefront, and create new JSP files to support the new function for the most viewed recipes.


Procedure

  1. In the Enterprise Explorer view, navigate to Stores > WebContent > Madisons > ShoppingArea > RecipeSection.

  2. Right-click the following JSP files and select Delete:

    1. RecipeSection.jsp

    2. RecipeCollection.jsp

    3. RecipeDisplay.jsp

  3. Right-click the RecipeSection folder and select Import. Expand General and select File system. Click Next, then click Browse and navigate to RecipeTopBrowsedSource\LOBTools\WebContent\Madisons\ShoppingArea\RecipeSection.

    Select the following files:

    • RecipeSection.jsp

    • RecipeCollection.jsp

    • RecipeDisplay.jsp

    • RecipeRankingsDisplay.jsp

    • ScrollingRecipeESpot.jsp

    Click Finish to import the files.

  4. In the Enterprise Explorer view, navigate to WC > xml > mapper.

  5. Open SEOUrlMapper.xml.

    1. Find the following code:

      <pathInfo_mapping>
                  <pathInfo_mapping name="RecipeDisplay1" requestName="RecipeDisplay">
                 
      <parameter name="project"/>
                  <parameter name="langId"/>
                  <parameter name="storeId"/>
                 
      <parameter name="catalogId"/>            
      
      </pathInfo_mapping>
      

      <pathInfo_mapping name="RecipeDisplay1" requestName="RecipeDisplay">
               
      <parameter name="project"/>
                  <parameter name="langId"/>
                  <parameter name="storeId"/>
           
      <parameter name="catalogId"/>
      
      </pathInfo_mapping>
      

    2. Replace it with the following code:

      </pathInfo_mapping>
                  <pathInfo_mapping name="RecipeDisplay1" requestName="RecipeDisplay">
                 
      <parameter name="project"/>
                      <parameter name="langId"/>
                      <parameter name="storeId"/>
             
      <parameter name="catalogId"/>
                  <parameter name="collectionId"/>
      </pathInfo_mapping>
      
      

      <pathInfo_mapping name="RecipeDisplay1" requestName="RecipeDisplay">
               
      <parameter name="project"/>
                  <parameter name="langId"/>
                  <parameter name="storeId"/>
           
      <parameter name="catalogId"/>
                  <parameter name="collectionId"/>
      </pathInfo_mapping>
      
      

      The collectionId matches the variable name defined in the Behavior Rule XML definition.

  6. Open RecipeCollection.jsp.

    1. Find the following code:

      <c:forEach var="project" items="${projects}"> 
      <wcf:url var="RecipeDisplayURL" value="RecipeDisplay1"> 
      <wcf:param name="project" value="${project.projectIdentifier.uniqueID}" /> 
      <wcf:param name="langId" value="${langId}" /> 
      <wcf:param name="storeId" value="${WCParam.storeId}" /> 
      <wcf:param name="catalogId" value="${WCParam.catalogId}" /> 
      <wcf:param name="collectionId" value="${param.collection}" /> 
      </wcf:url> 
      <div  class="Recipe_content_2"> 
      <a href="<c:out value="${RecipeDisplayURL}" />" ><U><c:out value="${project.projectIdentifier.externalIdentifier.name}" escapeXml="false"/></U></a> 
      </div> 
      </c:forEach> 
      

      Where <wcf:param name="collectionId" value="${param.collection}" /> is the new parameter.

  7. Open RecipeSection.jsp and RecipeCollection.jsp and note the following code:

    <%out.flush();%>
            <c:import url="${jspStoreDir}ShoppingArea/RecipeSection/RecipeRankingsDisplay.jsp">
                <c:param name="storeId" value="${WCParam.storeId}" />
                <c:param name="catalogId" value="${catalogId}" />
                <c:param name="langId" value="${langId}" />
                <c:param name="errorViewName" value="AjaxOrderItemDisplayView" />
            </c:import>
        <%out.flush();%>
    

    You can include the RecipeRankingsDisplay.jsp file to add ranking list functionality on the page where you want it displayed.

  8. Open ScrollingRecipeESpot.jsp. This JSP file is a new customized e-Marketing Spot. It can get the ranking data by calling the following code:

    <wcf:getData type="com.ibm.commerce.marketing.facade.datatypes.MarketingSpotDataType" 
    var="marketingSpotDatas" expressionBuilder="findByMarketingSpotName">
    

  9. Open RecipeRankingsDisplay.jsp.

    1. Find the following code:

      <%out.flush();%> 
      <c:import url="${jspStoreDir}ShoppingArea/RecipeSection/ScrollingRecipeESpot.jsp"> 
      <c:param name="langId" value="${langId}" /> 
      <c:param name="storeId" value="${WCParam.storeId}" /> 
      <c:param name="catalogId" value="${WCParam.catalogId}" /> 
      <c:param name="emsName" value="TopBrowsedRecipe" /> 
      <c:param name="scrollable" value="true" /> 
      <c:param name="skipAttachments" value="true"/> 
      <c:param name="pageView" value="scrollSideBarESpot"/> 
      <c:param name="rankingList" value="true"/> 
      </c:import> 
      <%out.flush();%> 
      

      Each e-Marketing Spot must contain a unique emsName. The JSP file above is created to import the e-Marketing Spot. By doing so, you can make the e-Marketing spot for the most viewed recipes be displayed on the corresponding store page.

      The emsName must be unique. When creating an e-Marketing Spot in the Management Center, the e-Marketing Spot name must match the value of emsName.


Related concepts

Rank list framework for marketing actions


Related tasks

Add an e-Marketing Spot to a store page (Management Center)

Create an e-Marketing Spot

< Previous | Next >


+

Search Tips   |   Advanced Search