Forum Discussion

rupamkhaitan's avatar
10 years ago

How can I extract latest topics across all forums inside a category page

I have a category page which has 4 sub-forums inside.

I want to pull all the latest topic inside my custom component, just the way lithium component does (Latest Topic Component)

 

I dont see direct URL which does that for us

 

something like http://community.lithium.com/community-name/restapi/vc/categories/id/[id] /boards

But it ask for board id further to pull all the threads inside that board, what i am looking for is if i have multiple boards inside a category i want to pull all the latest threads inside that category with one API call.

 

 

Please help.

    • rupamkhaitan's avatar
      rupamkhaitan
      Helper

      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_mody's avatar
        sunny_mody
        Advisor

        Hi,

         

        I believe this rest api should work for you :

         

        /restapi/vc/categories/id/{category_id}/topics/recent

         

        Thanks,

        Sunny