peterlu
10 years agoChampion
Categories Boards Posts Count - API v2 version
<#assign menuItems = ["CategoryA", "CategoryB", "CategoryC"] /> <div class="lia-component-custom-community-browser"> <div class="panel"> <ul> <#list menuItems as item> <#-- possible from v1 to v2? <#assign category = restadmin("/categories/id/${item}").category /> <li> <span>${category.title?html}</span> <ul> <#list category.boards.board as board> <#assign count = rest("/boards/id/${board.id}/posts/style/all/count").value?number /> <li><a href="${board.@view_href}">${board.title?html}</a><span>(${count?string(",##0")})</span></li> </#list> </ul> </li> --> </#list> </ul> </div> </div>
My question is:
If each category has 100 boards, my v1 version may need to do at least 300 api calls.
Not sure if there is a v2 version to reduce the number of api calls.