Help with API code
Hello! For some reason the following API only display posts from the tkb. It's supposed to show posting from tkb and forum. Has anyone run into this problem before? Any help will be appreciated. Thanks!
<#attempt>
<#assign messages = rest("2.0","/search?q=" + "SELECT subject, view_href, post_time_friendly, board.id, teaser, author FROM messages WHERE board.id IN('forum','tkb') ORDER BY post_time DESC LIMIT 5"?url) />
<#recover>
</#attempt>
<#if messages.message?size gt 0>
<div class="custom-recent-articles-container">
<div class="custom-recent-articles-heading-bar"><span class="custom-recent-articles-heading-bar-title">${text.format("")}</span></div>
<#list messages.data.items as message >
<#assign posted_by_userid = message.author.login?string />
<#assign posted_by_label = text.format("Posted By:") />
<div class="custom-recent-article-wrapper">
<div class="custom-article-header">
<div class="custom-article-subject"><a href="${message.view_href}">${message.subject}</a></div>
<div class="custom-article-posted-by">
<span class="author">${posted_by_label} <#if ((posted_by_userid != "") && (posted_by_userid != "Anonymous"))><@component id="common.widget.user-name" user="conv:${message.author.login}" /></#if></span>
</div>
</div>
<div class="custom-article-teaser">
<#if message.teaser?length gt 0>
${message.teaser} <span class="custom-read-more"><a href="${message.@view_href}">${text.format("")}</a></span>
</#if>
</div>
</div>
</#list>
</#if>
skylinegtr I think it's probably best to run 2 querries then:
<#assign messages_forum = rest("2.0","/search?q=" + "SELECT subject, view_href, post_time_friendly, board.id, teaser, author FROM messages WHERE board.id='forum' ORDER BY post_time DESC LIMIT 3"?url) />
and
<#assign messages_tkb = rest("2.0","/search?q=" + "SELECT subject, view_href, post_time_friendly, board.id, teaser, author FROM messages WHERE board.id ='tkb' ORDER BY post_time DESC LIMIT 2"?url) />