0

2 つのマクロがあり、1 つが別のマクロにネストされているとします。

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

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

使用法:

testNestingマクロから id パラメータの値を取得するにはどうすればよいですか?

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

1 に答える 1

0

内部マクロに属性を追加し、id を値として渡します

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

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

これが役に立てば幸いです

于 2013-03-11T19:36:49.473 に答える