combicart Posted March 7 Share Posted March 7 Hey, i'm currently building a website with a news section. On the overview page I would like to add a pagination so that users can easily switch from page to page. I already included the MarkupPagerNav setup. However I would like to adjust the output of the module and I'm not really sure how to adjust it to my needs. I would e.g. like to output the current page and the total number of pages. See example below of what I would like to achieve: Could someone point me in the right direction on how to output the correct variables? Thanks! Link to comment Share on other sites More sharing options...
Robin S Posted March 7 Share Posted March 7 The "1 to 10 of 20" part is something you get from PaginatedArray::getPaginationString() rather than from MarkupPagerNav. So if your paginated results are in a variable named $results you would do something like this: <p>Showing <?= $results->getPaginationString() ?> results</p> And the Previous/Next navigation: unfortunately MarkupPagerNav doesn't provide a direct solution for this. There's an open request for it: https://github.com/processwire/processwire-requests/issues/248 So for now you have to hide the numbered links with CSS (the easy option) or code your own Previous/Next links. 2 Link to comment Share on other sites More sharing options...
combicart Posted March 8 Author Share Posted March 8 @Robin S That's really great! Will use the combined setup with getPaginationString() and MarkupPagerNav to achieve the pagination markup. Thanks, for pointing me in the right direction! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now