Written by The Jahia Team
 
Developers
   Estimated reading time:
7.3.x.x 7.2.x.x

How can I include a css/js file from another folder as css or javascript in the module?

Answer

As other folders are blocked in the module. You have to add the folder where the css/js is stored to the static resources in manifest (pom.xml) of the module like (e.g. the additional folder is vendor):

 ...
    <properties>
        <jahia-depends>default</jahia-depends>
        <jahia-static-resources>/css,/icons,/javascript,/swf,/vendor</jahia-static-resources>
    </properties>
... 

Now the css file will be available. Now you can use the addTemplate tag. NOTE: the addTemplate tag base the css folder!!

So you have to add something like:

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

 

Related links