Forum Discussion
Hi qinglau ,
Let me just clarify my understanding. You would like to display 4 blog topics and exclude featured blog article from it. If my understanding is correct , this might be of help.
<#assign featuredThreadId = rest("/blogs/id/cs_blog/threads/featured").threads.thread.id />
<#assign blogList = rest("/blogs/id/cs_blog/topics").node_message_context />
<#assign counter = 0 />
<#assign limit = 4 />
<ul>
<#list blogList.message as blog>
<#if blog.id!=featuredThreadId && (counter< limit-1)>
<#assign counter = counter?number +1/>
<li>${counter} ${blog.subject} <br/></li>
</#if>
</#list>
</ul>
The above snippet is under the assumption , there would be only one featured article. If there might be more than one , we would have to change the code a bit.
Since I have initialized the counter as 0 , I have checked for limit-1 .
You can improvise on this.
Hope that helps.
Thanks,
Sam