Peter Falkenberg Brown Posted September 5, 2020 Share Posted September 5, 2020 Hi Folks, I am stuck, after scouring the API docs, module code, and forum questions. I'm trying to write code that upon the initial pressing of a search button will set the page number to something other than 1. For example, the query might return 50 pages, but I want to start by showing page 7, with the pagination boxes appearing on both sides of the highlighted box 7. Here's my code (setPageNum will only be used if it's an initial search button press (which I'll check with a hidden form field)). $results = $pages->find("$select_limit"); $pager = $modules->get('MarkupPagerNav'); $pager->setNumPageLinks($numPageLinks); $pager->setPageNum(7); $pagination = $pager->render($results); The returned pagination all looks good EXCEPT that it always starts at page 1 instead of page 7, like this: Any help would be greatly appreciated. Peter Link to comment Share on other sites More sharing options...
kixe Posted September 7, 2020 Share Posted September 7, 2020 try // ... $results->setStart(6); // index = 7 - 1 $pagination = $pager->render($results); 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