svn commit: r1815798 - in /ofbiz/ofbiz-plugins/trunk/cmssite: data/CmsSiteDemoData.xml template/cms/HtmlHead.ftl

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

svn commit: r1815798 - in /ofbiz/ofbiz-plugins/trunk/cmssite: data/CmsSiteDemoData.xml template/cms/HtmlHead.ftl

jleroux@apache.org
Author: jleroux
Date: Mon Nov 20 12:41:46 2017
New Revision: 1815798

URL: http://svn.apache.org/viewvc?rev=1815798&view=rev
Log:
Improved: Hardcoded stylesheets and javascript resources
(OFBIZ-)

The 'HtmlHead.ftl' file of the cmssite component contains following hardcoded
style sheet and javascript resources:
•/images/fieldlookup.js
•/images/selectall.js
•/images/ecommain.css
•/ecommerce/images/blog.css
•/content/images/contentForum.css

Thanks: Pierre Smits, Anil and Swapnil

Modified:
    ofbiz/ofbiz-plugins/trunk/cmssite/data/CmsSiteDemoData.xml
    ofbiz/ofbiz-plugins/trunk/cmssite/template/cms/HtmlHead.ftl

Modified: ofbiz/ofbiz-plugins/trunk/cmssite/data/CmsSiteDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/cmssite/data/CmsSiteDemoData.xml?rev=1815798&r1=1815797&r2=1815798&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/cmssite/data/CmsSiteDemoData.xml (original)
+++ ofbiz/ofbiz-plugins/trunk/cmssite/data/CmsSiteDemoData.xml Mon Nov 20 12:41:46 2017
@@ -41,6 +41,26 @@ under the License.
     <Content contentId="CMSS_HHEAD" contentTypeId="DOCUMENT" contentName="CMS Site HTML Head" dataResourceId="CMSS_HHEAD"/>
     <ContentPurpose contentId="CMSS_HHEAD" contentPurposeTypeId="SECTION"/>
 
+    <DataResource dataResourceId="FIELD_LOOKUP_JS" dataResourceTypeId="LINK" mimeTypeId="text/js" objectInfo="/common/js/util/fieldlookup.js"/>
+    <Content contentId="FIELD_LOOKUP_JS" contentTypeId="DOCUMENT" contentName="Field Lookup JS" dataResourceId="FIELD_LOOKUP_JS"/>
+    <ContentAssoc contentId="CMSS_HHEAD" contentIdTo="FIELD_LOOKUP_JS" sequenceNum="1" contentAssocTypeId="SUB_CONTENT" mapKey="js" fromDate="2014-10-02 00:00:00"/>
+
+    <DataResource dataResourceId="OFBIZ_UTIL_JS" dataResourceTypeId="LINK" mimeTypeId="text/js" objectInfo="/common/js/util/OfbizUtil.js"/>
+    <Content contentId="OFBIZ_UTIL_JS" contentTypeId="DOCUMENT" contentName="OFBiz Util JS" dataResourceId="OFBIZ_UTIL_JS"/>
+    <ContentAssoc contentId="CMSS_HHEAD" contentIdTo="OFBIZ_UTIL_JS" sequenceNum="2" contentAssocTypeId="SUB_CONTENT" mapKey="js" fromDate="2014-10-02 00:00:00"/>
+
+    <DataResource dataResourceId="ECOM_MAIN_CSS" dataResourceTypeId="LINK" mimeTypeId="text/css" objectInfo="/ecommerce/images/ecommain.css"/>
+    <Content contentId="ECOM_MAIN_CSS" contentTypeId="DOCUMENT" contentName="E-Commerce Main CSS" dataResourceId="ECOM_MAIN_CSS"/>
+    <ContentAssoc contentId="CMSS_HHEAD" contentIdTo="ECOM_MAIN_CSS" sequenceNum="1" contentAssocTypeId="SUB_CONTENT" mapKey="css" fromDate="2014-10-02 00:00:00"/>
+    
+    <DataResource dataResourceId="BLOG_CSS" dataResourceTypeId="LINK" mimeTypeId="text/css" objectInfo="/ecommerce/images/blog.css"/>
+    <Content contentId="BLOG_CSS" contentTypeId="DOCUMENT" contentName="Blog CSS" dataResourceId="BLOG_CSS"/>
+    <ContentAssoc contentId="CMSS_HHEAD" contentIdTo="BLOG_CSS" sequenceNum="2" contentAssocTypeId="SUB_CONTENT" mapKey="css" fromDate="2014-10-02 00:00:00"/>
+
+    <DataResource dataResourceId="CON_FORUM_CSS" dataResourceTypeId="LINK" mimeTypeId="text/css" objectInfo="/contentimages/css/contentForum.css"/>
+    <Content contentId="CON_FORUM_CSS" contentTypeId="DOCUMENT" contentName="Content Forum CSS" dataResourceId="CON_FORUM_CSS"/>
+    <ContentAssoc contentId="CMSS_HHEAD" contentIdTo="CON_FORUM_CSS" sequenceNum="3" contentAssocTypeId="SUB_CONTENT" mapKey="css" fromDate="2014-10-02 00:00:00"/>
+
     <DataResource dataResourceId="CMSS_DEMO_HEADER" dataResourceTypeId="ELECTRONIC_TEXT" dataTemplateTypeId="FTL"/>
     <ElectronicText dataResourceId="CMSS_DEMO_HEADER">
         <textData><![CDATA[

Modified: ofbiz/ofbiz-plugins/trunk/cmssite/template/cms/HtmlHead.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/cmssite/template/cms/HtmlHead.ftl?rev=1815798&r1=1815797&r2=1815798&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/cmssite/template/cms/HtmlHead.ftl (original)
+++ ofbiz/ofbiz-plugins/trunk/cmssite/template/cms/HtmlHead.ftl Mon Nov 20 12:41:46 2017
@@ -29,12 +29,15 @@ under the License.
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <title>${(decoratedContent.subcontent.title.render)!"CMS Site Generic Title (Set subcontent 'title' on your content!)"}</title>
     <link rel="shortcut icon" href="/images/ofbiz.ico" />
-    <script language="javascript" src="/common/js/util/fieldlookup.js" type="text/javascript"></script>
-    <script language="javascript" src="/common/js/util/OfbizUtil.js" type="text/javascript"></script>
-    <link rel="stylesheet" href="/ecommerce/images/ecommain.css" type="text/css"/>
-    <link rel="stylesheet" href="/ecommerce/images/blog.css" type="text/css"/>
-    <link rel="stylesheet" href="/contentimages/css/contentForum.css" type="text/css"/>
-
+    <#assign nothing = thisContent.setSortOrder("caSequenceNum")/>
+    <#assign nothing = thisContent.setMapKeyFilter("js")/>
+    <#list thisContent.subcontent_all as content>
+      <script src="${content.render!}" type="text/javascript"></script>
+    </#list>
+    <#assign nothing = thisContent.setMapKeyFilter("css")/>
+    <#list thisContent.subcontent_all as content>
+      <link rel="stylesheet" href="${content.render!}" type="text/css"/>
+    </#list>
     <meta name="description" content="${(decoratedContent.subcontent.metaDescription.render)!}"/>
     <meta name="keywords" content="${(decoratedContent.subcontent.metaKeywords.render)!}"/>
 </head>