3 Replies Latest reply on Dec 8, 2013 5:43 AM by manish12nov

    Problems defining new soy templates

    pearle

      I am attempting to add new templates to an existing soy file - however when I try and reference this template I get the error message 'ERROR: no template found for aaa.bbb.cccc' (where aaa.bbb.ccc is the template name.

       

      I have overlayed the soy file in my themes directory, and if I make a change to the existing template, the change appears on my page, so I know I have put the soy file in the correct place. However my new template doesn't seem to be picked up - am I missing a configuration steps somewhere?

        • Re: Problems defining new soy templates
          jdvande

          Have you declared the dependency on your new template?

           

          If I understand you correctly, you've modified a standard jive template and have it call your own new template?

           

          Say your overlayed soy template is jive.boring.template with a call to aaa.bbb.cccc.  Jive.boring.template needs an @depends template=aaa.bbb.cccc in its preceding comment block.

            • Re: Problems defining new soy templates
              pearle

              Hi - thanks for your quick reply!

               

              I'm not doing what you outline above, where an existing template makes a call to another template. Instead, I have a completely new template that I need to call. Rather than creating a new soy file, I have added the template to an existing soy file. I tried to create a new soy file with my 'new' template inside it, but that didn't work.

            • Re: Problems defining new soy templates
              manish12nov

              Hey Peter,

              If I understand you correctly, Here is what you need to do :


              1. Check the namespace in you soy file at the beginning of the file :

              example : {namespace jive.abc}


              2. Check on the template name you are referring :

              example : {template .main}


              3. Now, If you have both of them correctly in place, then you need to refer the soy for example in your struts file like this :

              <result name="define-result" type="soy">jive.abc.main</result>

               

              Or, If you are referring the soy in another soy file then use :

               

              {call jive.abc.main}

                                      {param xyz : xyzbean /}

                                     //pass your params here to be used in your soy.

              {/call}


              Make sure you are passing and declaring all the data you want to use in you soy file (as param). Hope it helps.