Jahia Dev Forum > Problem Aggregating...

0 (0 Good)
0 (0 Bad)

Problem Aggregating Theme Resources

by  sashok »  2013/08/05 09:16

Hello Jahiars,

 

I am currently working on a project that uses themes.

Here is an example code from the project.

 

<template:addResources type="javascript" resources="jquery.js" /> 

<c:if test="${! renderContext.editMode}">

       <template:addResources type="javascript" resources="js.js" />

       <template:addResources type="css" resources="reset.css" />

</c:if>     

<template:theme/>

 

The problem is that all resources that have been added with the <template:theme/>  tag are not aggregated and they appear as

<link id="staticAssetCSS1" rel="stylesheet" href="myCss.css” />

<link id="staticAssetCSS1" rel="stylesheet" href="myCss2.css” />

All other css and js files that have been added with addResouces tag are properly aggregated and minified.

<script id="staticAssetJavascript0" type="text/javascript" src="/resources/a56b23faa6989b3b5be7b8aa1722ac.min.js"></script>

Am I doing something wrong or there is a problem with the way Jahia handles theme resources?

Thank you for your help,

Alexander KIRILOV

  (sashok)

Number of messages  14
Registration date
0 (0 Good)
0 (0 Bad)

Re: Problem Aggregating Theme Resources

by  shyrkov »  2013/11/11 11:57

Hello Alexander,

 

the aggregation and minification is enabled only for "static" assets (CSS and JavaScript files), comming from modules (under <jahia-web-app-dir>/modules folder on the disk).

The theme resources (CSS) are actually maintaned in the JCR repository, so they are not considered in the aggregation/minification process.

You could check the HTML source code of the generated page in live mode.

The CSS assets, which have the following href form for example:

<link id="staticAssetCSS1" rel="stylesheet" href="/files/live/sites/mySite/templates/files/themes/theme-orange/theme-orange.css" media="screen" type="text/css"/>

won't be included into the aggregation, as they are comming from JCR repository (it is actually a file node under the path /sites/mySite/templates/files/themes/theme-orange/theme-orange.css)

 

Kind regards

Sergiy

 

  • Re: Problem Aggregating Theme Resources
    2013/11/11 11:57

    shyrkov <p> Hello Alexander,</p> <p> &nbsp;</p> <p> the aggregation and minification is enabled only for &quot;static&quot; assets (CSS and JavaScript files), comming from modules (under &lt;jahia-web-app-dir&gt;/modules folder on the disk).</p> <p> The theme resources (CSS) are actually maintaned in the JCR repository, so they are not considered in the aggregation/minification process.</p> <p> You could check the HTML source code of the generated page in live mode.</p> <p> The CSS assets, which have the following href form for example:</p> <pre id="line1"> <span>&lt;link id=&quot;staticAssetCSS1&quot; rel=&quot;stylesheet&quot; href=&quot;/files/live/sites/mySite/templates/files/themes/theme-orange/theme-orange.css&quot; media=&quot;screen&quot; type=&quot;text/css&quot;/&gt;</span></pre> <p> <span>won&#39;t be included into the aggregation, as they are comming from JCR repository (it is actually a file node under the path </span>/sites/mySite/templates/files/themes/theme-orange/theme-orange.css)</p> <p> &nbsp;</p> <p> Kind regards</p> <p> Sergiy</p> <p> &nbsp;</p>

  • Number of messages  407
    Registration date Nov 11, 2013
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page