Forum Discussion

cstone's avatar
8 years ago

Can a variable be used as a Macro parameter?

For example: <#macro repeat count> <#list 1..count as x> <#nested> </#list> </#macro>   <#assign boardCount= rest("categories/id/sales/boards/count").value/> <@repeat count={boardCount}...
  • cike's avatar
    cike
    8 years ago

    Hi cstone,

     

    simply remove the curly braces from the variable name you want to use in your macro:

     

    <#assign count = boardCount % 3 />
    <@repeat count=count >
    <li class="detail-tile-shim"></li>
    </@repeat>

     

    Cheers,

    Christian