Macros Freemarker-将参数传递给嵌套宏

Macros Freemarker-将参数传递给嵌套宏,macros,freemarker,Macros,Freemarker,假设我有两个宏,一个嵌套在另一个宏中 [#macro testNestingTOP id] [#nested] [/#macro] [#macro testNesting] id: ${id} [/#macro] 用法: 如何从testNesting宏检索id param的值 [@testNestingTOP id='SOME VALUE']  [@testNesting /] [/@testNestingTOP] 将属性添加到内部宏,并将id作为值传递给它 [@testN

假设我有两个宏,一个嵌套在另一个宏中

[#macro testNestingTOP id]
   [#nested]
[/#macro]

[#macro testNesting]
   id: ${id}
[/#macro]

用法

如何从testNesting宏检索id param的值

[@testNestingTOP id='SOME VALUE']
  [@testNesting /]
[/@testNestingTOP]

将属性添加到内部宏,并将id作为值传递给它

[@testNesting innerID ]
//code
[@testNesting /]

[@testNestingTOP id='SOME VALUE']
   //code
  [@testNesting innerID=id/]
  //code
[/@testNestingTOP]
我希望这能有所帮助