ikhwanb
10 years agoAdept
Custom BlogMessage showing repeating results
I am trying to customize the BlogMessage layout with custom component.
I refer post https://community.lithium.com/t5/Developers-Discussion/Linking-blog-archive-dates-to-a-custom-blog/m-p/83154 and manage to get the list messages showing in BlogPage.
However, I got repeated list of message in a page. The output is something like this:
-Row 1
-Post 1
-Post 2
-Post 3
-Row 2
-Post 1
-Post 2
-Post 3
(Row repeated 3 times)
Please assist. Thanks in advance!
My code structure is as per below
<#if page.name =="BlogPage"> <#assign messages = rest("2.0","/search?q=" + "SELECT * FROM messages WHERE board.id = '${coreNode.id}' AND depth = 0 ORDER BY post_time DESC"?url).data.items![] /> <#-- Message Content --> <#list messages as blogpost> <#-- Customize HTML for blog post display --> </#list> <#else> <@component id="message-header" /> <@component id="body" /> <@component id="message-footer" /> ......... </#if>