I'm new and struggling with velocity templates. I have few templates in hand with lots of macros in it.
// file b.vm
#macro (bmacro)
from b macro
#end
// file a.vm
#parse("//temp//b.vm")
from a
#bmacro()
My expectation is to get
from a
from b macro
however, I am getting only "from a" as outcome. But when I place any static text outside bmacro, it is getting along.
By the way, I'm using NVelocity from castle project.
Thanks
The macro doesn't work because NVelocity (and its ancestor Velocity) determine if
#bmacrois a directive or macro at parse time, while the#bmacromacro gets discovered at runtime as it jumps into the other template, and so it is passed through as text.I answered this other question with a detailed answer a few months ago that had the same problem: macros not rendering in NVelocity