cancel
Showing results for 
Search instead for 
Did you mean: 

'companyhome' not valid?

geri-m
Champ in-the-making
Champ in-the-making
Dear Alfresco Community,

If was trying a simple example in a Free-Marker Template from <http://wiki.alfresco.com/wiki/FreeMarker_Template_Cookbook>.

Unfortuntaly

 <b>Company Home Space:</b> ${companyhome.properties.name}</p>

causes an error when rendering the page. "# Error generating rendition using folder.get.html.ftl: freemarker.core.NonStringException: "

If also tried several other examples (eg. retriving stores etc.) but always the size of the node is 0, zB:

   <p>User: ${userhome.children?size}</p>
      
   <p>Document: ${document.children?size}</p>

   <p>Stores ${avm.stores?size}</p>

I do have the feeling that I'm doing something obviously wrong, but I was not able to figure out what … any help is appreciated.

Best, geri-m
2 REPLIES 2

sandramokeeffe
Champ in-the-making
Champ in-the-making
Did you figure out what the problem was?  I'm seeing the same issue, trying to access companyhome from my ftl rendition template for my web form.

mrogers
Star Contributor
Star Contributor
Forgive me if I'm misunderstanding your problem but I don't think you can't run javascript within a freemarker template (the ftl file).   What I've always done (which works) is to run some java or javascript that puts values into the "model" object which you can then display with
freemarker.     The javascript goes in a .js file?

The other "gotcha" is where are you running your javascript?  Different javascript "root" objects will be available depending on your environment.  Typical environments are in a browser window, server side non alfresco (e.g. surf) or server side alfresco.