Juergen Posted March 6, 2016 Share Posted March 6, 2016 Hello @ all, I have created a product page where customers can filter products depending on various attributes. I dont want to show all product matches on one page so I use a pagination to split it. So far so good - everything works as expected. The problem starts when I press the pagination button to see the next page (fe page 2). Then all products will be shown instead of the selected ones. As you can see: The pagination shows all pages Here are some code examples: // Get all products matching the filter criteria $p = $pages->find("template=products$productkindselect$offerkindselect, limit=$itemnumber"); $resultcounter = count($p); if ($resultcounter > 0) { //loop through each item foreach ($p as $child) { //Output the children fe $child->title; } } The code for the pagination $results = $p; echo $results->renderPager(array( 'currentItemClass' => "active", 'nextItemLabel' => "<span class='fa fa-angle-double-right'></span>", 'previousItemLabel' => "<span class='fa fa-angle-double-left'></span>", 'listMarkup' => "<nav><ul class='pagination'>{out}</ul></nav>", 'itemMarkup' => "<li class='{class}'>{out}</li>", 'linkMarkup' => "<a href='{url}'><span>{out}</span></a>" )); $pagination = $results->renderPager(); Has anyone tried to use a pagination with a filter an has a working solution? best regards Link to comment Share on other sites More sharing options...
adrian Posted March 6, 2016 Share Posted March 6, 2016 I think what you are looking for is whitelist: $input->whitelist($name, $value) Read about it under the getVars section on this page: https://processwire.com/api/modules/markup-pager-nav/ 1 Link to comment Share on other sites More sharing options...
Juergen Posted March 6, 2016 Author Share Posted March 6, 2016 Thanks adrian, I will try this. 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