Hello all,

I wanted to include a custom Freemarker template at the end of the body of every page. Because the default STK main.ftl does not currently provide a hook for that I copied the main.ftl and modified it to include my custom template at the desired location in the file. I placed this modified version under /vpro-sitestat/templates instead of /templating-kit/templates, along with the custom template that is being included.

I added a version handler that modifies all site definitions and sets the modified main.ftl as the templatePath in their prototype.

Now a weird problem has occured. A colleague developed a new site in Magnolia. Upon installing my module the site definition is correctly updated, but he gets this template error:

----
Error reading included file vpro-sitestat/templates/singleton/mainArea.ftl
The problematic instruction:
----------
==> include def.mainArea.template [on line 46, column 21 in
vpro-sitestat/templates/main-with-sitestat.ftl]
----

All I added to the modified version of main.ftl is this block before </body>:

----
[#include "/vpro-sitestat/templates/vpro-sitestat.ftl"]
----

That is an absolute include. Somehow a nested STK include seems to end up looking outside the STK tree. Can someone explain why Magnolia (or the Freemarker template resolver or whoever is responsible for this) is looking for vpro-sitestat/templates/main-with-sitestat.ftl?

I already opened this ticket and hope that removing all relative paths from STK will solve this issue: http://jira.magnolia-cms.com/browse/MGNLSTK-537 Am I correct in thinking that is the case?

For now I guess I either need to move my modified main.ftl into the /templating-kit tree or find the bug in the STK templates that triggers this include, is that correct?

Nils Breunese.

P.S. I'm using STK 1.2.

----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to