Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.26-incubating
-
None
Description
When invoking a macro inside of a #list the loop variable is not in scope to be used resolving the argument values to the macro call.
Example
<#macro button caption> content irrelevant. </#macro> <#list ["a","b","c"]> <#items as loopvar> ${loopvar?counter} -- works ${loopvar?index} -- works <p class="${loopvar?index}"> -- works <@button caption="${loopvar?index}" /> -- FAILS </#items> </#list>
The @button macro call fails with the message:
The left hand operand of ?index must be a loop variable, but there's no loop variable in scope with this name: loopvar
Shouldn't loopvar be in scope for evaluating those macro argument values?