Java Posted January 23, 2023 Share Posted January 23, 2023 Hi The pagination on my site works, that is to say button 1 gives page 1, button 2 gives page 2, 3 page 3 and so on. But page 1 always remains the current, active page no matter what I do, so the pagination display always remains 1 2 3 NEXT. I've searched the forum front to back and back to front, but haven't found a solution to this problem. The code I am using is simple: $items = $page->children("limit=n"); $pager = modules('MarkupPagerNav'); echo $pager->render($items); echo $page->body; foreach($page->children("limit=15") as $child) The attached image shows the generated code. What could be wrong here? Link to comment Share on other sites More sharing options...
wbmnfktr Posted January 23, 2023 Share Posted January 23, 2023 This could help here: https://processwire.com/docs/front-end/markup-pager-nav/#are-there-any-side-effects Link to comment Share on other sites More sharing options...
Java Posted January 24, 2023 Author Share Posted January 24, 2023 Thanks wbmnfktr. I've seen that and I've tried it, but it makes no difference. More out of desperation than wisdom I changed "n" to "15" and it works! So the code is now: $items = $page->children("limit=15"); echo $pager->render($items); foreach($page->children("limit=15") as $child) I'm curious about the explanation of this. 1 Link to comment Share on other sites More sharing options...
taotoo Posted January 25, 2023 Share Posted January 25, 2023 I think "n" is simply an instruction to type the number of results that you would like to have per page in place of it. 1 Link to comment Share on other sites More sharing options...
wbmnfktr Posted January 28, 2023 Share Posted January 28, 2023 On 1/24/2023 at 11:31 AM, Java said: I changed "n" to "15" and it works! Ok... I didn't notice your usage of n in your query/selector but what @taotoo said is true. n is a placeholder for n=number/integer for the amount of entries/pages/items (however you wanna call it). It's the number of entries you want to see. 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