Samples > Starter stores > Starter store enhancements > Remote widgets > Work with remote widgets
Enable the Share link for a wish list remote widget
The Madisons starter store provides store pages and code to demonstrate how customers can share wish list remote widgets.
To familiarize yourself with the Madisons implementation, you can try associating the Share link on the Personal Wish List page to a wish list remote widget you have created in KickApps App Studio. Then consider using a similar implementation for your own store.
Before you begin
- Make sure the server is set up according to the Remote widget setup and implementation checklists. If the server is not accessible from the Internet, you can still do the procedure in this topic; however, you cannot see the feed data when you test the Share link at the end of this procedure.
- Create a wish list remote widget using KickApps App Studio.
- To see a screen capture of the Madisons Personal Wish List page with the Share link included, see My Account: Personal Wish List.
This task explains how to specify KickApps widget IDs for the Share link on the Madisons Personal Wish List page. As a result, when a customer clicks the Share link, the widgets with the IDs you specified are available on the "Share this widget" page.
Procedure
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- Open the JSP file for the Personal Wish List page at the following path:
WCDE_INSTALL/workspace/Stores/WebContent/Madisons/UserArea/ServiceSection/InterestItemListSubsection/WishListResultDisplay.jsp
- Within the JSP file, locate the block of code similar to this example:
<div class="right" id="getWidgetButton"> <c:url var="feedURL" value="${restURLScheme}://${pageContext.request.serverName}:${restURLPort}${restURI}/stores/${WCParam.storeId}/GiftLists/${selectedWishListId}?guestAccessKey=${defaultWishList.accessSpecifier.guestAccessKey}"> <c:param name="responseFormat" value="atom" /> <c:param name="langId" value="${langId}" /> <c:param name="currency" value="${CommandContext.currency}" /> </c:url> <c:import url="${jspStoreDir}Snippets/Marketing/ESpot/RemoteWidgetButtons.jsp"> <c:param name="showWidget" value="true" /> <c:param name="showFeed" value="false" /> <c:param name="sidebarWidgetId" value="" /> <c:param name="bannerWidgetId" value="" /> <c:param name="feedURL" value="${feedURL}" /> <c:param name="widgetIconStyle" value="top" /> </c:import>
In the previous block of code, the showWidget parameter enables the Share link on the page. The value is set to true when you enable the change flow option for Wish list remote widgets in WebSphere Commerce Accelerator.
- Complete the following steps to specify the IDs of the KickApps wish list widgets you created. For the Share link to display on the Personal Wish List page, specify a widget ID for either the sidebarWidgetID parameter, or the bannerWidgetId parameter, or both:
- Get the KickApps widget IDs for the wish list widgets you want customers to share. KickApps assigns a unique ID to each widget. You can get the widget ID by logging on to your KickApps affiliate account and then viewing the embed code for the widget. Search the embed code for widgetID= and take note of the widget ID number.
- In the WishListResultDisplay.jsp file, add the widget IDs to the appropriate parameters:
- For a vertical sidebar-style widget, add the widget ID to this parameter:
<c:param name="sidebarWidgetId" value="widgetID"/>
- For a horizontal banner-style widget, add the widget ID to this parameter:
<c:param name="bannerWidgetId" value="widgetID" />
If you have two versions of the widget, one sidebar and one banner, you can use both of these parameters. As a result, when a customer clicks the Share link, the customer can choose either the sidebar or banner layout on the "Share this widget" page.
- Optional: If you added custom layers to the widget that are not part of the WebSphere Commerce widget templates, you can add functions to the custom layers using some optional parameters:
- To allow customers to change the color of a custom layer, specify the layer name using one or both of these parameters:
- For the widget ID you specified for the sidebarWidgetID parameter, add:
<c:param name="sidebarColors" value="layer_name_in_KickApps" />
- For the widget ID you specified for the bannerWidgetID parameter, add:
<c:param name="bannerColors" value="layer_name_in_KickApps" />
- To define a custom feed layer in the widget, add this parameter
<c:param name="feedLayer" value="layer_name_in_KickApps" />
- Save and close the JSP file.
- View the results on the Madisons Personal Wish List store page. For the Share link to display on the page:
- You must have specified a widget ID value for either the sidebarWidgetID parameter or the bannerWidgetID parameter, or both.
- A site administrator must have configured WebSphere Commerce to communicate with KickApps.
If you do not see the Share link, check that both these conditions are met.
- Make required changes to the layout and position of the link on the page. The following file controls the link image and position:
WCDE_INSTALL/workspace/Stores/WebContent/Madisons/Snippets/Marketing/ESpot/RemoteWidgetButtons.jsp
- To test the Share link:
- Log on to the Madisons starter store as a test customer.
- Create a wish list containing three or four products.
- On the Personal Wish List page, click the Share link. The Share this widget page displays, showing a preview of the widget.
- Use the functions on the page, make changes to the layout (available only if you specified both sidebarWidgetID and bannerWidgetId values), the dimension, and background color of the widget.
- Use the functions on the page, share the widget directly to a social network, or copy the embed code so that you can paste it into a Web page outside of WebSphere Commerce.
Related concepts
Related tasks
Create an e-Marketing Spot remote widget
Add a Share link for an e-Marketing Spot remote widget
Add a Subscribe link for an e-Marketing Spot feed
Create 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