Forum Discussion
HaidongG
11 years agoLithium Alumni (Retired)
Hi qinglau ,
your array initialization looks alright, I tried your code (with minor modification) with my test environment, it is working. I guess, you may have to focus with the following points to debug
- what is the value for ${rootPath} in your component?
- what is the value for latestFeatured(coreNode.id)?
- any CSS blocking the display?
<#assign rootPath = "/boards/id/my-category-id" /> <#assign articles=[]> <#assign AllblogArticles = rest("${rootPath}/topics?restapi_response.style=view").node_message_context /> <#list AllblogArticles.message as msg> <#if msg.id!="33333"> <#assign articles = articles + [ msg ] /> </#if> </#list> <#list articles as msg> ${msg.id} <br> </#list>
qinglau
11 years agoMentor
Hi HaiDong,
1. rootPath is the current node level. The code is
<#if nodeType == 'board'> <#assign rootType = "blogs"> <#assign rootPath = "blogs/id/" + rootNodeId/> <#else> <#assign rootType = "categories"> <#assign rootPath = "categories/id/" + rootNodeId/> </#if>
2. latestFeatured(coredNode.id) will return featured topic ID in "init" format.
3. There is no CSS blocking the code.
Is there a way to convert the int value into string value? and then i can compare "featuredID !=msg.id" Currently, i got error said only compare string to string or int to int error.
Thank you,
Cheers,
Qing
Related Content
- 11 years ago