Author: rayb
Date: Mon Jun 11 11:35:14 2007 New Revision: 546218 URL: http://svn.apache.org/viewvc?view=rev&rev=546218 Log: Fix to ensure the HTML title tag is properly populated on category and product detail pages, as it was not coming through. Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/includes/header.ftl ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/product.bsh Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/includes/header.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/includes/header.ftl?view=diff&rev=546218&r1=546217&r2=546218 ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/includes/header.ftl (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/includes/header.ftl Mon Jun 11 11:35:14 2007 @@ -21,7 +21,7 @@ <#-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <title>${(productStore.storeName)?if_exists}: <#if title?has_content>${title}<#elseif titleProperty?has_content>${uiLabelMap.get(titleProperty)}</#if></title> + <title><#if title?has_content>${title}<#elseif titleProperty?has_content>${uiLabelMap.get(titleProperty)}</#if>: ${(productStore.storeName)?if_exists}</title> <#if layoutSettings.shortcutIcon?has_content> <link rel="shortcut icon" href="<@ofbizContentUrl>${layoutSettings.shortcutIcon}</@ofbizContentUrl>" /> </#if> Modified: ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml?view=diff&rev=546218&r1=546217&r2=546218 ============================================================================== --- ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml (original) +++ ofbiz/trunk/applications/ecommerce/widget/CatalogScreens.xml Mon Jun 11 11:35:14 2007 @@ -163,6 +163,7 @@ <set field="MainColumnStyle" value="center"/> <set field="titleProperty" value="PageTitleCategoryPage"/> + <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh"/> </actions> <widgets> <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> @@ -177,9 +178,6 @@ <screen name="category-include"> <section> - <actions> - <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh"/> - </actions> <widgets> <section> <condition> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh?view=diff&rev=546218&r1=546217&r2=546218 ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh Mon Jun 11 11:35:14 2007 @@ -26,6 +26,7 @@ import org.ofbiz.entity.*; import org.ofbiz.product.catalog.*; import org.ofbiz.product.category.CategoryWorker; +import org.ofbiz.product.category.CategoryContentWrapper; detailScreen = "categorydetail"; catalogName = CatalogWorker.getCatalogName(request); @@ -59,14 +60,15 @@ if (category != null) { if (category.get("detailScreen") != null) detailScreen = category.getString("detailScreen"); - pageContext = context.get("page"); - if (pageContext instanceof Map) { - pageContext.put("title", category.getString("description")); + CategoryContentWrapper categoryContentWrapper = new CategoryContentWrapper(category, request); + context.put("title", categoryContentWrapper.get("CATEGORY_NAME")); + categoryDescription = categoryContentWrapper.get("DESCRIPTION"); + if (categoryDescription != null) { + context.put("metaDescription", categoryDescription); + context.put("metaKeywords", categoryDescription + ", " + catalogName); } else { - pageContext.setProperty("title", category.getString("description")); + context.put("metaKeywords", catalogName); } - context.put("metaDescription", category.getString("description")); - context.put("metaKeywords", category.getString("description") + ", " + catalogName); context.put("productCategory", category); } Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/product.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/product.bsh?view=diff&rev=546218&r1=546217&r2=546218 ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/product.bsh (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/product.bsh Mon Jun 11 11:35:14 2007 @@ -77,8 +77,7 @@ if (product != null) { context.put("product", product); - content = context.get("page"); - content.put("title", product.getString("productName")); + context.put("title", product.getString("productName")); context.put("metaDescription", product.getString("productName")); keywords = new ArrayList(); keywords.add(product.getString("productName")); |
Free forum by Nabble | Edit this page |