Thursday, 24 September 2015

SEO PAGE DEF OVERRIDE



Assume in ItemDisplay.jsp you are displaying title and meta-desc for items using the
below wcf:getData tag.
<wcf:getData type="com.ibm.commerce.seo.facade.datatypes.SEOXXXType" var="seoType" expressionBuilder="getPageDefinitionByCatEntryIdOrPageName">
               <wcf:param name="defaultPageName" value="ITEM_PAGE" />
               <wcf:param name=”catentry_id” value=${param.catentry_id}   
</wcf:getData>

At server side, the title and meta-desc is identified using the following flow chart:
  
Case 1: No specific overrides defined for this catEntry  in SEOPAGEDEFOVR table 
Result: Will use the defaultPageName to get the TMD details. Get the SEOPAGEDEF_ID
for pageName = ITEM_PAGE defined for this store in SEOPAGEDEF table and then get the
details from the lang specific table. 

Case 2: Specific overrides defined for this catEntry. In this case there will be an entry in
the SEOPAGEDEFOVR for this catEntry.
Result: Get the SEOPAGEDEF_ID defined for this catEntry in the SEOPAGEDEFOVR
table and ignore the defaultPageName=ITEM_PAGE parameter. Use this SEOPAGEDEF_ID
and get the details from lang specific table 

Case 3: Parent of this catEntry enforcing its definition for all its children. In this case, 
there will be an entry in SEOPAGEDEFOVR for the parent catEntry
with APPLY_TO_CHILD marked as true. And this catEntry will have no entries.
Result: Get the SEOPAGEDEF_ID defined for the parent catentry and then get details
as in case 2.

When we need TMD for catEntries or categories, we always search for TMD with
predefined pageName, based on the catentry type, say PRODUCT_PAGE, ITEM_PAGE,
KIT_PAGE, BUNDLE_PAGE. If an override is present in SEOPAGEDEFOVR table
for the catentry or catgroup, then that TMD will be displayed. If no overrides are present
for the catentry, then an entry in SEOPAGEDEFOVR with catentry_id = 0 will be searched.
Always there will be one entry in SEOPAGEDEFOVR table with catentry_id set to 0 and
this entry will be treated as default entry. So even overrides can use same PageName
and hence PageName is not unique index in SEOPAGEDEF table.

2 comments: