Details
-
Feature
-
Resolution: Obsolete
-
High
-
None
-
5.3.2
-
None
-
None
Description
I need to implement pagination for a customer project, in order to be able to paginate through search results.
The search uses SOLR with facets and the pagination links obviously have to keep current query parameters.
Here are the steps I followed to do this :
- I had to create my own SOLR Pagerfanta Adapter as there isn't any native one in ez kernel (why ?)
- In my main controller, the solr request 's rows and limit attributes are updated depending on the "page" query parameter (this is actually done in a SolrR Request Pagination Helper I created)
- My main controller finally returns the pagerfanta object which is available in my template .
- My template calls the pagerfanta extension with an undocumented parameters : "routeParams", in order to send the current query parameters to pagerfanta renderer.
Example : pagerfanta( pager, "projectpagername", {"routeName": location,"routeParams":app.request.query.all})
I really think this "routeParams" parameter should be documented in Confluence as I struggled a lot to find it. - I created my own "projectpagername" view and template in order to customize the pagerfanta html code and css classes so that it matches our project's design.
Here is the main issue I struggled with : There are no options/methods in pagerfanta default views/templates to show a link to first and last page, but only to previous and next page.
This is a shame as it is very often asked by our customers. This therefore need to be improved in my opinion.
I also didn't find any pagerfanta view/templates in ez kernel. Isn't there any ?