Solved
Forum Discussion
OlivierS
10 years agoLithium Alumni (Retired)
skylinegtr in future post, please list what you've been trying ;)
Now, based on this tutorial, and the category resource, I assume this code would work:
<h2>JOIN THE DISCUSSION</h2> <#--Use the rest FreeMarker context object, passing the rest_version parameter and LiQL query (encoded by appending ?url) --> <#assign categories = rest("2.0","/search?q=" + "SELECT id, title, topics.count(*), messages.count(*), views, view_href FROM categories ORDER BY topics.count(*) ASC"?url) /> <ul> <#list categories.data.items as category > <li><a href=“${category.view_href}”>${category.title}</a><br /> Topics count: ${category.topics.count} <br /> Messages count: ${category.messages.count} <br /> </li> </#list> </ul>
Disclaimer: I won't be responsible for any side effects of my code. Please test, test, and test on your stage environment first before pushing to production ...
skylinegtr
10 years agoMentor
OlivierS – Thanks for your help with this. Sorry, I should have been clearer.
What I’m trying to do is to display 3 subject/topics for each category in the custom components.
For example:
The Blog has Topic/Subject- Bartz Blog, Ben’s Suport, Support News, Process
Knowledge & Support has Topic/Subject-Customer Knowledge Base, Customer Product Ideas, Partner Knowledge Base.
It’s my first time dealing with API’s.
Related Content
- 2 years ago
- 10 years ago
- 4 years ago