Jahia in English > Function of template:addResour...

0 (0 Good)
0 (0 Bad)

Function of template:addResources in module?

by  fhatfield@ipponusa.com »  2016/06/10 18:14

Hello,

I'm trying to create a module that will let me drop a content carousel into a web project. Naturally, this relies on some css and javascript, which I put into a folder in the resources directory of the module. In the view for the carousel nodeType, I have several <template:addResources...> tags for the css and js. I have the module as a dependency in the templateSet and enabled in the web project I'm trying to put it in, so I am currently able to drop a new carousel content item onto the page. However, I don't think the css and js are being loaded, because the carousel isn't working and making changes to the css doesn't cause any changes in the web project.

Is there something else I need to do in order to pass along the resources needed by the module besides just adding it as a dependency and enabling it? The top of my jsp for the node view looks like this.

<template:addResources type="css" resources="../../CarouselResources/owl-carousel/owl.carousel.css" />
<template:addResources type="css" resources="../../CarouselResources/owl-carousel/owl.theme.css" />
<template:addResources type="css" resources="../../CarouselResources/owl-carousel/owl.transitions.css" />

<template:addResources type="javascript" resources="../../CarouselResources/owl-carousel/owl.carousel.js" /

  • Function of template:addResources in module?
    2016/06/10 18:14

    fhatfield@ipponusa.com <p>Hello,</p> <p>I&#39;m trying to create a module that will let me drop a content carousel into a web project. Naturally, this relies on some css and javascript, which I put into a folder in the resources directory of the module. In the view for the carousel nodeType, I have several &lt;template:addResources...&gt; tags for the css and js. I have the module as a dependency in the templateSet and enabled in the web project I&#39;m trying to put it in, so I am currently able to drop a new carousel content item onto the page. However, I don&#39;t think the css and js are being loaded, because the carousel isn&#39;t working and making changes to the css doesn&#39;t cause any changes in the web project.</p> <p>Is there something else I need to do in order to pass along the resources needed by the module besides just adding it as a dependency and enabling it? The top of my jsp for the node view looks like this.</p> <blockquote> <p>&lt;template:addResources type=&quot;css&quot; resources=&quot;../../CarouselResources/owl-carousel/owl.carousel.css&quot; /&gt;<br /> &lt;template:addResources type=&quot;css&quot; resources=&quot;../../CarouselResources/owl-carousel/owl.theme.css&quot; /&gt;<br /> &lt;template:addResources type=&quot;css&quot; resources=&quot;../../CarouselResources/owl-carousel/owl.transitions.css&quot; /&gt;</p> <p>&lt;template:addResources type=&quot;javascript&quot; resources=&quot;../../CarouselResources/owl-carousel/owl.carousel.js&quot; /</p> </blockquote>

  • Number of messages  7
    Registration date Jun 10, 2016
    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