Samples > Starter stores > Starter store enhancements > Remote widgets > Work with remote widgets


Add a Subscribe link for an e-Marketing Spot feed

The Madisons starter store provides store pages and code to demonstrate how customers can subscribe to e-Marketing Spot feeds. To familiarize yourself with the Madisons implementation, you can try adding a Subscribe link to an e-Marketing Spot. Then consider using a similar implementation for the own store.


Before you begin

This task walks you through the steps for adding a Subscribe link to an e-Marketing Spot. As a result, when a customer clicks the Subscribe link, the e-Marketing Spot feed displays in a browser.

To subscribe to the feed, the customer can copy the URL and paste it into a feed reader.

Several e-Marketing Spots on the Madisons starter store pages already include a Subscribe link:

Use the steps in this procedure to add a Subscribe link to a different e-Marketing Spot.


Procedure

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.

  2. Open the JSP file for the store page containing the e-Marketing Spot to which to add a Subscribe link.

  3. Within the JSP file, search for the name of the e-Marketing Spot, for example, HomePageRow3Ads.

  4. Locate the <c:import tag for the specific e-Marketing Spot. The <c:import tag should be above the line for the emsName parameter containing the e-Marketing Spot name, as shown in the following example for the HomePageRow3Ads e-Marketing Spot:

    <c:import url="${jspStoreDir}Snippets/Marketing/ESpot/ContentAreaESpot.jsp">   
    <c:param name="emsName" value="HomePageRow3Ads" />   
    <c:param name="numberContentPerRow" value="2" />   
    <c:param name="catalogId" value="${WCParam.catalogId}" />   
    <c:param name="errorViewName" value="AjaxOrderItemDisplayView" />
    </c:import>
    

  5. Above the <c:import tag, paste the following code snippet, which sets the URL and parameters for the e-Marketing Spot feed:

    <c:url var="feedURL" value="${restURLScheme}://${pageContext.request.serverName}:${restURLPort}${restURI}
    /stores/${WCParam.storeId}/MarketingSpotData/ems_Name">     <c:param name="responseFormat" value="atom" />     <c:param name="langId" value="${langId}" />     <c:param name="currency" value="${currency}"/>
    </c:url>
    

  6. For the <c:url tag in the snippet you just pasted, replace ems_Name with the name of the e-Marketing Spot, for example, HomePageRow3Ads.

    The result should now look similar to this example code:

    <c:url var="feedURL" value="${restURLScheme}://${pageContext.request.serverName}:${restURLPort}${restURI}
    /stores/${WCParam.storeId}/MarketingSpotData/HomePageRow3Ads">   
    <c:param name="responseFormat" value="atom" />   
    <c:param name="langId" value="${langId}" />   
    <c:param name="currency" value="${currency}"/>
    </c:url>
    <c:import url="${jspStoreDir}Snippets/Marketing/ESpot/ContentAreaESpot.jsp">   
    <c:param name="emsName" value="HomePageRow3Ads" />   
    <c:param name="numberContentPerRow" value="2" />   
    <c:param name="catalogId" value="${WCParam.catalogId}" />   
    <c:param name="errorViewName" value="AjaxOrderItemDisplayView" />
    </c:import>
    

  7. To add the Subscribe link to the e-Marketing Spot, add the following parameters within the <c:import tag:

    <c:param name="showFeed" value="true" />
    <c:param name="feedURL" value="${feedURL}"/>
    

  8. Save and close the JSP file.

  9. View the results on the store page.

  10. Make required changes to the layout and position of the link in relation to the e-Marketing Spot on the JSP page. The following file controls the link image and position:

    WCDE_INSTALL/workspace/Stores/WebContent/Madisons/Snippets/Marketing/ESpot/RemoteWidgetButtons.jsp
    

  11. Test the Subscribe link:

    1. Click the Subscribe link. The browser displays the feed in the manner the browser supports. For example, some browsers display the formatted feed whereas others display the XML code. Either way, the feed URL displays in the address bar.

    2. To subscribe to the feed, copy the feed URL and paste it into a feed reader.


Related concepts

Remote widgets


Related tasks

Create an e-Marketing Spot remote widget

Add a Share link for an e-Marketing Spot remote widget

Create a wish list remote widget

Enable the Share link for a wish list remote widget

Create a gift registry remote widget

Enable the Share link for a gift registry remote widget

Related reference

Troubleshoot remote widgets and feeds

Remote widgets change flow options

E-Marketing Spot remote widget and feed flows

Wish list remote widget flows, including multiple wish lists

Remote widget setup and implementation checklists


+

Search Tips   |   Advanced Search