[FreeMarker-user] Is there any way to include from outside the template root directory?
Generates text that depends on changing data (like dynamic HTML).
Brought to you by:
revusky
From: Johann P. <joh...@ch...> - 2011-01-28 00:52:36
|
I am using FreeMarker with FMPP to generate files from the command line from XML source files. To do that, I have created a lot of macros that simplify accessing the information in that kind of XML files. This should work with a number of different templates, each in their own template dir to generate different kinds of output files. But for all of them I would need the same set of macros! So ideally, the macros would be *outside* each of the template directories and shared by them -- but this seems to be impossible because <#include> always stays inside the template directory. Is there any way, any trick tom make <#include "../../somefile.ftl"> work when that relative path points outside the template directory? This would be great in cases where the user actually knows what he is doing. Any help would be greatly appreciated -- this would immensely simplify the maintenance of the files that contain all those macros that I need to share between the different template directories. |