AnsweredAssumed Answered

apply processTemplate to a collection

Question asked by leonardo.celati on Oct 24, 2014
Latest reply on Oct 26, 2014 by leonardo.celati
In a script I am trying to apply the processTemplate to a collection of article.

var template = ….
var nodeRef = 'workspoace://…..';
var collection = search.findNode(nodeRef);
var args = {};
var rendering = collection.processTemplate(template,args);

This is the .ftl

<#assign collection = document.assocs['ws:webassets']>

<#list collection as article>

However I am getting:

<cite>Expression document is undefined on line 1, column 23 in string://fixed.</cite>

I suppose that Alfresco is obviously right, because a collection is not meant to fit in the document root object.
If this is the case, are there any alternative for rendering a collection by means of freemarker ?