Forum Discussion

yeeyang's avatar
yeeyang
Adept
13 years ago

Most Recent Blog articles with offset

Hello Lithosphere,

 

In Re: http://lithosphere.lithium.com/t5/Lithium-Developers/How-to-retrieve-top-5-recent-posts-from-blog-or-posts-from/td-p/34806

 

So I did the 5 most recent blog article custom component but I wanted to offset that by <anyNumber> so that I can show some and then call in the others in another area or row. Is there a way to offset the REST call?

 

I've tried &offset, &start, and &limit but no go... did lithium use something else?

 

Many thanks!

  • Okay, that's weird. When using on my community the &page parameter works like a pagination parameter as expected. So on your case

    ...?page_size=1&page=1

     ...should show the latest blog post.

    ...?page_size=1&page=2 

     ...should show the second oldest and so on.

  • Hi,

     

    Yes, Lithium is special and therefor uses the &page=2 parameter as the 1-based index of the page to be returned. :) 

    • yeeyang's avatar
      yeeyang
      Adept

      Thank you Claudius,

       

      While that does work if you have two blogs, it doesn't offset the posts.

       

      For example, if I'm using page-size=3, that gives me the 3 blog posts. What I am would like is to create a custom component which gives me the most recent blog post (page-size=1), then create 3 widgets under it to give me posts 2-4 (2, 3, and 4).

       

      &page gives me posts from another blog (which is very helpful to know but not the solution I was actually looking for.

      • Claudius's avatar
        Claudius
        Boss

        Okay, that's weird. When using on my community the &page parameter works like a pagination parameter as expected. So on your case

        ...?page_size=1&page=1

         ...should show the latest blog post.

        ...?page_size=1&page=2 

         ...should show the second oldest and so on.