Forum Discussion
rupamkhaitan - you need to add /nested at the end, it will pull all the boards nested inside the top category for which you are making the call
http://community.lithium.com/community-name/restapi/vc/categories/id/[id] /boards/nested
- rupamkhaitan11 years agoHelper
I tried that but it doesnt give me all the threads inside each forum page for one category page.
For eg: I have one category page with ID : cat1
Inside this category i create four forum with ID: F1, F2, F3, F4
Now i want all the latest topic to be pulled from each forum in one component, i have achieved this by looping through each forum and rendering the HTMl, but i was wondering if there is any straight forward way with one URL which gives the consolidated information.
There is a built-in component in lithium saying 'Latest Topic' which does what i am looking for, but thats the built component and I want a custom component with similar feature.
Putting /nested in the URL is not giving me all the threads for each forum.
please help
- sunny_mody11 years agoAdvisor
Hi,
I believe this rest api should work for you :
/restapi/vc/categories/id/{category_id}/topics/recent
Thanks,
Sunny
- rupamkhaitan11 years agoHelper
this doesnt work because we have sub-category inside each category.
And each sub-category has forum pages.
Under each forum page we have threads/messages
And i want to get all the messages/threads from each forum under each sub-category.
The only way I could achieve this is by looping
<#list rest("/categories/id/{CATEGORY_ID}").category.categories.category as category>
<#list rest("/categories/id/{CATEGORY_ID}/${category.@href}").category.boards.board as board>
<#assign threads = rest("/categories/id/knowledgebase/${category.@href}/${board.@href}/threads/>
</#list>
</#list>So now my threads variable has all the data for each forum under each sub-category.
Cheers
Rupam
Related Content
- 2 years ago
- 3 years ago
- 2 years ago