Hey VikasB, thanks for the reply. The example code I added results in errors. What is the correct syntax for passing in a variable as parameter to a macro?
Here is what I am trying to achieve:
- I am creating a listing of our Boards for the CategoryPage, in the form of "tiles"
- The tiles are arranged in rows of 3, depending on how many Boards are present in a given Category, the final row may have 1 tile, 2 tiles, or 3 titles (if the total count is divisible by 3)
- When there are less than 3 tiles in the final row, I need to add a "shim", so the final tile is the same width as the rest of the tiles.
I plan to achieve this by getting a count of the boards and calculating the remainder when divided by 3:
<#assign boardCount= rest("categories/id/{coreNode.title}/boards/count?restapi.response_style=view").value/>
<#macro repeat count>
<#list 1..count as x>
<#nested>
</#list>
</#macro>
<@repeat count={boardCount % 3} >
<li class="detail-tile-shim"></li>
</@repeat>
If I hard code the count to be something like "2" it works just fine but I keep getting errors when adding a variable as the value of "count" in that macro.