Can anyone give me an example of how they include an ftl file in another WCM Forms rendition ftl file where the included file is not in the same space? I've seen several posts about this but nothing quite fits with what I need to do in WCM. I have a ftl library file with lots of functions I dont want to repeat in WCM Forms rendition templates and Web Script view templates so including from WebForms and Web Scripts is necessary. I just can't find a working example of how to do this. Can it be done? The wiki says the included file can be referenced by a relative path to the rendition being generated but then is it visible to web scripts? Seems such a simple requiement in a way so I'm sure someone out there has done it before.
Thanks for the reply, ideally I'd like to be able to lookup the ftl library by store path because I'd like to include it in both Web Script ftl files and Web Forms ftl files. I will search the code for this example though it may well lead me in the right direction.
I've avoided this issue as much as I can, duplicating freemarker macros rather than attempt to use the quite unpredictable include directive for a common library in a Web Form rendering template, but no more, no more. So… I've tracked down the unpredictability of the include directive to org.alfresco.web.forms.RenderingEngineTemplateImpl where the included template is first sought out in the space where the web form in question is stored. e.g. Data dictionary -> Web Forms -> Article, this prevents me from including common library to be used across all Web Forms as this would preferably reside in Data dictionary -> Web Forms -> lib or similar. The org.alfresco.web.forms.RenderingEngineTemplateImpl code then attempts to retrieve by uri - prefixing the include path with url of the preview webapp. This is where random behaviour seems to occur. The path will sporadically find the requested URI and just as likely produce a 404 resulting in a failure of the include directive. There are a couple of ways to get around this but I'd rather know why a resource is available from say http://admin.webappname.www--sandbox… but not from http://preview.admin.webappname.www--sandbox… in other words why are some of the virtualised web apps incomplete? Sometimes shutting both Tomcat instances down and cleaning out the work and temp dirs will alleviate the problem but only sometimes. I'd love to know more about this issue as the virtual server seems to be a bit of an unknown quantity.