Hi, i am trying to include a html file in the FTL. it is giving
Error reading included file content/www/us/en/x/y/jcr:content/rr.html
The problematic instruction:
----------
==> include "${model.privacyPolicyPath}" [on line 50, column 23 in /apps/x/xx/xxx/xxxx/content/legalagreement/er.ftl]
freemarker.template.TemplateException: Error reading included file content/www/us/en/as/asd/jcr:content/rr.html
please provide your inputs.
Solved! Go to Solution.
Views
Replies
Total Likes
I am not a Freemarker expert but my understanding is that include directive is only applicable for including another Freemarker template, not for including an resource like a HTML page. According to this (http://freemarker.org/docs/app_faq.html#faq_servlet_include) you have to use the include_page directive, however that directive is dependent on use of the FreemarkerServlet, which doesn't apply if you are using a Scripting Engine implementation of Freemarker. Are you using the Sling project's Freemarker scripting engine or something custom.
Views
Replies
Total Likes
Does the node at "/content/www/us/en/as/asd/jcr:content/rr.html" actually exist?
Views
Replies
Total Likes
Seems like slash (/) is missing at the beginning.
Views
Replies
Total Likes
I am not a Freemarker expert but my understanding is that include directive is only applicable for including another Freemarker template, not for including an resource like a HTML page. According to this (http://freemarker.org/docs/app_faq.html#faq_servlet_include) you have to use the include_page directive, however that directive is dependent on use of the FreemarkerServlet, which doesn't apply if you are using a Scripting Engine implementation of Freemarker. Are you using the Sling project's Freemarker scripting engine or something custom.
Views
Replies
Total Likes
we are using Sling project's Freemarker scripting engine.
Views
Replies
Total Likes
Views
Likes
Replies