svn commit: r546263 - in /ofbiz/branches/release4.0/applications: ecommerce/webapp/ecommerce/includes/ ecommerce/widget/ order/webapp/ordermgr/WEB-INF/actions/entry/catalog/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r546263 - in /ofbiz/branches/release4.0/applications: ecommerce/webapp/ecommerce/includes/ ecommerce/widget/ order/webapp/ordermgr/WEB-INF/actions/entry/catalog/

rayb-2
Author: rayb
Date: Mon Jun 11 13:36:27 2007
New Revision: 546263

URL: http://svn.apache.org/viewvc?view=rev&rev=546263
Log:
Fix to ensure the HTML title tag is properly populated on category and product detail pages, as it was not coming through. trunk r546218

Modified:
    ofbiz/branches/release4.0/applications/ecommerce/webapp/ecommerce/includes/header.ftl
    ofbiz/branches/release4.0/applications/ecommerce/widget/CatalogScreens.xml
    ofbiz/branches/release4.0/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh
    ofbiz/branches/release4.0/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/product.bsh

Modified: ofbiz/branches/release4.0/applications/ecommerce/webapp/ecommerce/includes/header.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/ecommerce/webapp/ecommerce/includes/header.ftl?view=diff&rev=546263&r1=546262&r2=546263
==============================================================================
--- ofbiz/branches/release4.0/applications/ecommerce/webapp/ecommerce/includes/header.ftl (original)
+++ ofbiz/branches/release4.0/applications/ecommerce/webapp/ecommerce/includes/header.ftl Mon Jun 11 13:36:27 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/branches/release4.0/applications/ecommerce/widget/CatalogScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/ecommerce/widget/CatalogScreens.xml?view=diff&rev=546263&r1=546262&r2=546263
==============================================================================
--- ofbiz/branches/release4.0/applications/ecommerce/widget/CatalogScreens.xml (original)
+++ ofbiz/branches/release4.0/applications/ecommerce/widget/CatalogScreens.xml Mon Jun 11 13:36:27 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/branches/release4.0/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh?view=diff&rev=546263&r1=546262&r2=546263
==============================================================================
--- ofbiz/branches/release4.0/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh (original)
+++ ofbiz/branches/release4.0/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/category.bsh Mon Jun 11 13:36:27 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/branches/release4.0/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/product.bsh
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/product.bsh?view=diff&rev=546263&r1=546262&r2=546263
==============================================================================
--- ofbiz/branches/release4.0/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/product.bsh (original)
+++ ofbiz/branches/release4.0/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/product.bsh Mon Jun 11 13:36:27 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"));