Pagination

Anish Joshi asked on November 12, 2019 12:53

Hi

Just looking through the documentation on Kentico 12 SP, but there is nothing on the documentation which covers anything on pagination for lists, blogs etc...

Could someone point me in some direction in where I can find anything on this?

Regards

Anish

Recent Answers


Roman Hutnyk answered on November 12, 2019 13:20

I assume you're talking about Kentico MVC. In such case you need to handle it the same way as you'd do with regular .net: pass either page number or skip/take pair to controller.

Regarding API Document Query has appropriate methods to implement it, e.g.

// Retrieves the second page of size 3 of smartphone pages.
DocumentQuery smartphones = DocumentHelper.GetDocuments("CMS.Smartphone")
                                .OnSite("CorporateSite")
                                .Path("/Products/", PathTypeEnum.Children)
                                .WhereLike("DocumentName", "Apple%")
                                .Page(1, 3);

You can find more samples @ https://docs.kentico.com/k12/developing-websites/loading-and-displaying-data-on-websites/writing-transformations/reference-transformation-methods

0 votesVote for this answer Mark as a Correct answer

Anish Joshi answered on November 12, 2019 14:18

Hi Roman

Thanks for sending this across will have a play about with that, regarding the link you sent it says its only available for portal engine model no the SP?

0 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on November 12, 2019 14:29

Sorry, I've sent you wrong link (copied from another tab in browser). Try this one please: https://docs.kentico.com/k12sp/custom-development/working-with-pages-in-the-api

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.