Updating the view and pattern names in the wcf:url tags of the storefront JSPs
In this lesson, you update the SEO pattern names
in the URL construction tags wcf:url for the
smartphone and tablet starter stores to use the pattern names for
the Aurora starter store as defined in the previous lesson. The corresponding
hyperlinks on the corresponding storefront JSPs will reflect the new
SEO URLs. For more information about SEO URL construction,
see SEO-friendly URL construction overview.
About this task
Note:
- In Version 7 Feature Pack 3, SEO URLs are constructed using the pattern template definitions. Precedence is given to the patternName attribute over the value attribute.
- You must update the value attribute of the wcf:url tag accordingly.
Procedure
View and pattern updates to the smartphone starter store
- Update the patterns in the smartphone starter store CachedHeaderDisplay.jsp to
HomePageURLWithLang
.File Path File name Stores > WebContent > Aurora > mobile20 > include > styles > style1 > CachedHeaderDisplay.jsp - In Enterprise Explorer, navigate to the file path in the table and open the JSP file. Switch to Source view.
- Search for wcf:url tags with
patternName="m20HomeURLWLang"
. For each occurrence in the file, replace withpatternName="HomePageURLWithLang"
. - Search for wcf:url tags with
patternName="m20TopCategoriesURL"
. For each occurrence in the file, replace withpatternName="HomePageURLWithLang"
.
- Update the patterns in the smartphone starter store SubCategores.jsp file.
File Path File name Stores > WebContent > Aurora > mobile20 > ShoppingArea > CatalogSection > CategorySubsection SubCategories.jsp - In Enterprise Explorer, navigate to the file path in the table and open the file. Switch to Source view.
- Search for the line
<c:set var="patternName" value="m20CategoryURLWPaging" />
. Replace"m20CategoryURLWPaging"
with"CategoryURLWPaging"
. - Search for the line
<c:set var="patternName" value="m20CategoryURLWParentCategory" />
. Replace"m20CategoryURLWParentCategory"
with"CategoryURLWParentCategory"
. - Search for the line
<c:set var="patternName" value="m20TopCategoryURLWPaging" />
. Replace"m20TopCategoryURLWPaging"
with"TopCategoryURLWPaging"
. - Search for the line
<c:set var="patternName" value="m20TopCategoryURL" />
. Replace"m20TopCategoryURL"
with"CanonicalCategoryURL"
. - Search for tags with
patternName="m20CategorySearchURL"
and for each occurrence, replace withpatternName="CanonicalCategoryURL"
. - Save and close the file.
- Replace
m20TopCategoryURL
withCanonicalCategoryURL
in the smartphone starter store TopCategoriesDisplay.jsp file.File Path File name Stores > WebContent > Aurora > mobile20 > ShoppingArea > CatalogSection > CategorySubsection TopCategoriesDisplay.jsp - In Enterprise Explorer, navigate to the file path in the table and open the JSP files. Switch to Source view.
- Search for wcf:url tags with
patternName="m20TopCategoryURL"
. For each occurrence in the file, replace withpatternName="CanonicalCategoryURL"
. - Save and close the file.
- Replace
m20ProductURL
withProductURL
in the JSP files that are listed in the following table.File Path File name Stores > WebContent > Aurora > mobile20 > ShoppingArea > CatalogSection > CatalogEntrySubsection ProductCompareResultGridDisplay.jsp Stores > WebContent > Aurora > mobile20 > ShoppingArea > CatalogSection > SearchSubsection SearchBasedNavigationCategories.jsp Stores > WebContent > Aurora > mobile20 > ShoppingArea > ShopcartSection OrderItemDisplay.jsp Stores > WebContent > Aurora> mobile20 > Snippets > Catalog > CatalogEntryDisplay CachedBundleDisplay.jsp CachedPackageDisplay.jsp Stores > WebContent > Aurora > mobile20 > Snippets > MultipleWishList WishListItems.jsp Stores > WebContent > Aurora> mobile20 > UserArea > AccountSection > ServiceSection > EFlyerSubsection MarkhamCentre.jsp MarkvilleMall.jsp Ontario.jsp WardenPlaza.jsp - In Enterprise Explorer, navigate to the file paths in the table and open the files. Switch to Source view.
- Search for wcf:url tags with
patternName="m20ProductURL"
. For each occurrence in the file, replace withpatternName="ProductURL"
.Note: This tutorial uses the desktop SEO pattern with the corresponding parameters structure to minimize JSP changes. The desktop Aurora storefront JSP files contain additional logic to select the different pattern names when more category information is available. - Save and close the file.
- Replace
m20ProductDisplayView
withProductDisplay
in the JSP file listed in the following table.File Path File name Stores > WebContent > Aurora > mobile20 > Snippets > Marketing > ESpot FeaturedProductsESpot.jsp - In Enterprise Explorer, navigate to the file path in the table and open the file. Switch to Source view.
- Search for tags containing the term
"m20ProductDisplayView"
. For each occurrence in the file, replace the term"m20ProductDisplayView"
with"ProductDisplay"
. - Save and close the file.
View and pattern updates to the tablet starter store
- Replace
TabletHomeURL
with HomePageURLWithLang in each of the JSP files that are listed in the following table.File Path File name Stores > Webcontent > Aurora > tablet index.jsp Stores > Webcontent > Aurora > tablet > include> styles > style1 CachedHeaderDisplay.jsp Stores > Webcontent > Aurora > tablet > ShoppingArea> CheckoutSection OrderConfirmation.jsp Stores > WebContent > Aurora > tablet > UserArea LanguageCurrencyDisplay.jsp - In Enterprise Explorer, navigate to the file paths in the table and open the JSP files. Switch to Source view.
- Search for wcf:url tags with
patternName="TabletHomeURL"
. For each occurrence in the file, replace withpatternName="HomePageURLWithLang"
.Note: In the<wcf:url>
tags, you might notice that in addition to the patternName attribute, the value attribute may contain a tablet-specific view name. This value is used if the SEO pattern is unavailable or if the SEO feature is not enabled. For this tutorial, it is not essential that these values be updated. - Save and close the file.
- Replace
TabletCategoryURLWParentCategory
withCategoryURL
in the JSP files that are listed in the following table and add an additional<wcf:param>
for the top category.File Path File name Stores > WebContent > Aurora > tablet > Snippets > Catalog > CategoryDisplay CategoriesNavDisplay.jsp ProductsPopup.jspf - In Enterprise Explorer, navigate to the file path in the table and open the files. Switch to Source view.
- Search for wcf:url tags with
patternName="TabletCategoryURLWParentCategory"
. For each occurrence in the file, replace withpatternName="CategoryURL"
. - In each of the JSP files, locate the following code
block:
<wcf:url var="SubcategoryURL" patternName="CategoryURL" value="tCategoriesDisplayView"> <wcf:param name="storeId" value="${storeId}"/> <wcf:param name="catalogId" value="${catalogId}"/> <wcf:param name="langId" value="${langId}"/> <wcf:param name="categoryId" value="${subcategory.categoryId}"/> <wcf:param name="parent_category_rn" value="${topCategory.categoryId}"/> </wcf:url>
- An additional parameter for the top category is required
to generate the SEO URL using the CategoryURL pattern. Add the following <wcf:param>
parameter to the <wcf:url> element:
<wcf:param name="top_category" value="${topCategory.categoryId}"/>
The updated code block should resemble the following code block:
<wcf:url var="SubcategoryURL" patternName="CategoryURL" value="tCategoriesDisplayView"> <wcf:param name="storeId" value="${storeId}"/> <wcf:param name="catalogId" value="${catalogId}"/> <wcf:param name="langId" value="${langId}"/> <wcf:param name="categoryId" value="${subcategory.categoryId}"/> <wcf:param name="top_category" value="${topCategory.categoryId}"/> <wcf:param name="parent_category_rn" value="${topCategory.categoryId}"/> </wcf:url>
- Save and close the file.
- Replace
TabletCategoryURL
withCanonicalCategoryURL
in each of the JSP files that are listed in the following table.File Path File name Stores > WebContent > Aurora > tablet > Snippets > Catalog > CategoryDisplay CategoriesNavDisplay.jsp ProductsPopup.jspf Stores > WebContent > Aurora > tablet > Snippets> Marketing > ESpot CategoryRecommendation.jspf Stores > WebContent > Aurora > tablet > Snippets> ReusableObjects CategoriesNavDisplay.jsp Stores > WebContent > Aurora> tablet > Snippets > Search ActiveFacetDisplay.jspf CachedSuggestions.jsp CategoryFacetDisplay.jspf - In Enterprise Explorer, navigate to the file paths in the table and open the JSP files. Switch to Source view.
- Search for wcf:url tags with
patternName="TabletCategoryURL"
. For each occurrence in the file, replace withpatternName="CanonicalCategoryURL"
. - Save and close the file.
- Replace
TabletProductURL
withProductURL
in the JSP files that are listed in the following table.File Path File name Stores > WebContent > Aurora > tablet > ShoppingArea> CatalogSection > CatalogEntrySubsection ProductCompareResultGridDisplay.jsp Stores > WebContent > Aurora> tablet > Snippets > Catalog > CatalogEntryDisplay CatalogEntryQuickViewComponents.jspf CatalogEntryQuickViewDialogContents.jsp CatalogEntryThumbnailDisplay.jsp Stores > WebContent > Aurora > tablet > Snippets> Search CatalogEntryThumbnailDisplay.jsp - In Enterprise Explorer, navigate to the file paths in the table and open the files. Switch to Source view.
- Search for wcf:url tags with
patternName="TabletProductURL"
. For each occurrence in the file, replace withpatternName="ProductURL"
. - Save and close the file.