6 Replies Latest reply on Apr 22, 2012 3:50 PM by hberes

    Jive 5: soy files not picked up in custom theme




      I  would appreciate some guidance on creating custom theme in Jive 5. I  have a custom theme "alfresco" created through Admin System >  Settings > Themes. It consists of two soy files that are  modifications of Jive's nav/createmenu.soy and  placepicker/placepicker.soy. The purpose is to customize Nav Bar "Create" menu and container picker.


      My files seem to compile fine. After  restarting the server, under jiveHome\www\resources\scripts\gen I see  gen-themes\alfresco\soy that contains JavaScript files compiled from soy  files in my custom theme. The application, however, still appears to be  using default set of JavaScript files in jiveHome\www\resources\scripts\gen\soy. I have the  Global theme set to "alfresco".


      I run my local instance with the following configuration:




      My custom theme is under web\src\main\themes\alfresco


      What am I doing wrong?


      Thank you,


        • Re: Jive 5: soy files not picked up in custom theme

          It seems that there is currently no way to add a dependency of a JavaScript file in a theme to a soy overlay. However, it is possible to overlay soy files in both Themes and Plugins, and fortunately, dependencies to JavaScript files in Plugins are resolved correctly if specified in the following format in a soy file:

          * @depends path=/plugins/<plugin name>/<path to javascript file (starting from plugin dir)>

          So you could overlay createmenu.soy in your Plugin (or Theme), and change the @depends entry for main.js accordingly (or add another @depends).

          • Re: Jive 5: soy files not picked up in custom theme

            I am having a similar issue.  However in my case, I have added a new .soy file with my own namespace (I'm not trying to overlay anything, just trying to create new UI in my own soy files).  In the SoyTemplateRegistryImpl class, it sees my file in readThemes, but its not being parsed in parseAll.  Also because I'm in devMode, the files aren't being compiled.


            Am I missing something?  In the admin console, my file shows up.  When I try rendering my file using:

            <@soy.render template="mynamespace.nav.navbar" data=skin.navBarViewProvider.getNavBarInstance(selLink) />


            I get the error in the console:

            java.lang.IllegalArgumentException: No associated path found for template 'mynamespace.nav.navbar'.  Please verify that this template exists.

            [INFO] [talledLocalContainer]     at com.jivesoftware.community.web.soy.SoyResourceBundler.getTofu(SoyResourceBundler.java:307)

            • Jive 5: soy files not picked up in custom theme

              I found that it works when the .soy file is in a plugin.  It just isn't working when it's in a theme.