假设我有两个宏,一个嵌套在另一个宏中。
[#macro testNestingTOP id]
[#nested]
[/#macro]
[#macro testNesting]
id: ${id}
[/#macro]
用法:
如何从 testNesting 宏中检索id param的值?
[@testNestingTOP id='SOME VALUE']
[@testNesting /]
[/@testNestingTOP]
答案 0 :(得分:0)
将属性添加到内部宏并将id作为值传递给它
[@testNesting innerID ]
//code
[@testNesting /]
[@testNestingTOP id='SOME VALUE']
//code
[@testNesting innerID=id/]
//code
[/@testNestingTOP]
我希望这可以帮助