Hello, In velocity for now, we can't use the '$macro.myVar' to retrieve the result of a child macro. Because of this limitation we must use a global variable (which as a risk of conflict with an other part of code which use the same variable. Let's take an example:
#macro(myChildMacro $return)
#set($return = $NULL)
#setVariable("$return" "my new value")
#end
#macro(myParentMacro)
#myChildMacro($macro.childResult)
$macro.childResult
#end
#myParentMacro()
This code won't work, so we have this result
This is because we call 'myChildMacro' with the variable '$macro.childResult'. To make it working, instead we must use a global variable like '$childResult' which is in the global context. |