AnsweredAssumed Answered

Hint of the day : Apply a template to specific document

Question asked by farhan on May 20, 2009
I was able to use Javascript to apply template to one or more specific documents by taking help from:

http://forums.alfresco.com/en/viewtopic.php?f=36&t=18750&p=61565&hilit=apply+specific+template#p61565

Here is the code:

   
document.addAspect("cm:templatable");
query = "PATH:\"app:company_home/app:dictionary/app:content_templates/cm:" + " ThumbnailView.ftl" + "\"";
var templateRef = search.luceneSearch(query);
document.properties["cm:template"]=templateRef[0];

P.S. Place the *.FTL file in the Data Dictionary/Presentation Template folder.

Outcomes