Solved
Forum Discussion
TariqHussain
8 years agoBoss
maxwelldhsu - Yes, you will need to use JQuery to perform the show and hide function. Suggestion regarding your code, you can use API V2 in the place of API V1, it will save you multiples calls. e.g
API V1
<#assign blog = rest("boards/id/videos/topics").node_message_context /> <ul> <#list blog.message as article>
<#assign articleBody = rest("/messages/id/${article.id}/body").value /> <li>
<a href="${article.@view_href}">${article.subject}</a>
<p class="article-body">${articleBody}</p>
</li> </#list> </ul>
API V2
<#assign blog = rest("2.0", "/search?q=" + "select id,view_href,subject,body from messages where board.id = 'videos' and depth = 0"?url).data.items![] />
<ul>
<#list blog as article>
<li>
<a href="${article.view_href}">${article.subject}</a>
<p class="article-body">${article.body}</p>
</li>
</#list>
</ul>
You can toggle the article-body by using jQuery and set it hidden on the page load.
maxwelldhsu
8 years agoGuide
Thanks TariqHussain, I'll try this later and let you know how it goes!
Related Content
- 10 years ago
- 4 months ago