I have the following freemarker template:
[#local snippet ][#noparse]
[#assign out ]value: ${v}
[/#assign]
[/#noparse]
[/#local]
[#assign hook = snippet?interpret ]
...
[#macro trigger ]
[@hook /]
[/#macro]
...
[#list values as v ]
[@trigger ]
[/#list]
${out}
What it essentially does is defining a hooks to execute at a certain later moment and a macro to trigger it's execution.
When I try to render this template, i get the following error:
The following has evaluated to null or missing:
==> v [in template "xxx.ftl->anonymous_interpreted" at line 1, column 17]
It might be interesting to note that the following:
[#list values as v ]
[@hook ]
[/#list]
is just working, i.e. rendering the template as I would expect, printing value: xxx for each value in the list.
- Does anybody know what is going wrong here?
- Is there any way to make this work as expected?
EDIT
I just discovered that the error doesn't occur if instead of an interpreted snippet I pass a regular macro:
[#assign hook = myMacro ]
...
but not if the macro is defined in another namespace.