cancel
Showing results for 
Search instead for 
Did you mean: 

Importing Alfresco templates to a custom template

sihnu
Champ in-the-making
Champ in-the-making
Hi,

I'm implementing a custom controller and in my template I would like to include Alfresco template alfresco-template.ftl. The path to the template is alfresco/templates/org/alfresco/include/alfresco-template.ftl. How do I include the template to my custom template? I have noticed that Alfresco includes the template like this
<#include "include/alfresco-template.ftl" />
. But this is relative path and my custom template is in different directory. So I guess I should use absolute path. I've tried this /alfresco/templates/org/include/alfresco-template.ftl but it doesn't refer to correct path of the file and I get error template is not found: <blockquote>Caused by: java.io.FileNotFoundException: Template alfresco/templates/org/include/alfresco-template.ftl not found.</blockquote>Very simple problem but I don't know how to solve this. I've tried googling the answer with no luck.

Thanks in advance.
2 REPLIES 2

s_palyukh
Star Contributor
Star Contributor
You missed "alfresco" word in your path after "org" and before "include".
More information about #include directive in ftl -> http://freemarker.org/docs/ref_directive_include.html

sihnu
Champ in-the-making
Champ in-the-making
Hi, thanks for the reply.

Yes, it seems I missed alfresco from the path but still it doesn't seem to point to right place. I think the root for absolute path points to tomcat/shared/classes/alfresco/web-extension/site-webscripts and that's why I can't refer to the template. I guess it's impossible. So I'm trying to come up with another solution for the problem now. I guess using alfresco-template.ftl is not mandatory. I already have an idea how to proceed. Anyway, thanks for the reply.