Home › Toolset Professional Support › [Resolved] Pagination doesn't work with search
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Our next available supporter will start replying to tickets in about 7.44 hours from now. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
This topic contains 16 replies, has 3 voices.
Last updated by Minesh 4 months, 3 weeks ago.
Assisted by: Minesh.
I am trying to:
I wanted to add a View to my site with Search bar and pagination. Unfortunately pagination works well until I add Search View. After that pagination is visible, links are ok (as open in new tab works ok) but buttons are not clickable.
Issue stops when delete Search View block.
Link to a page where the issue can be seen:
hidden link
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi there
I visited your page, and I can see that when trying to click the pagination links it triggers a JavaScript error in the console and the link does not work.
Would it be possible to get access to your site to see how you have this set up? Depending on what we find it could be necessary to take a copy of the site for further testing.
Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site.
I checked the admin access details you shared, I can able to login to admin but I do not have admin capabilities so I can not access Toolset and other components.
Can you please grant admin rights so that I can access all admin features without any restricitons.
In addition to that:
In order to minimize the cause of the issue and to ensure there is no conflict between the theme/plugins you use:
Could you please try to resolve your issue by deactivating all third-party plugins as well as the default theme to check for any possible conflicts with any of the plugins or themes?
- Do you see any difference?
I have set the next reply to private which means only you and I have access to it.
Account is admin now.
I see on the home page in backend admin you have two view blocks added:
- hidden link
May I know why you added two views that query same post type and seems output same loop?
Hi,
Because I want map to show all the entries and query to be paginated.
As I understand - the first view you added is to display only map with all results by default and then the second view you added is for custom search with pagination and you want that the map should also display the custom search filtered markers as well as with pagination.
Is this correct?
Yes, that's correct.
I was told in other ticket that the only way to achieve such behavior is to create two separate views.
I see the site you shared is production site.
Can you please setup a test page that should be 1:1 copy of your current problem "homepage" where I can tweak the things and play with it or you can setup a sandbox site that should be 1:1 copy of your current site where I can play with and change things.
I have set the next reply to private which means only you and I have access to it.
You can proceed. The site is under development and I took all the backups.
It seems the view you created is corrupted or have some issue but however in this case you should use mix of views like legacy view to display map and block view to display your custom search.
I've enable the legacy view by enabling the setting:
- https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/
Then created the following legacy view that will help us to display map with all markers:
- hidden link
More info:
- https://toolset.com/documentation/legacy-features/views-plugin/
Then created the following test page where I've added the above legacy view that holds the map as well as added block view:
- hidden link
With block view you can add your desired custom search filters and format the loop output as required.
Added the following filter hook to "Custom Code" section offered by Toolset:
- hidden link
add_filter( 'wpv_view_settings', 'func_enable_view_pagination', 5, 2 ); function func_enable_view_pagination( $view_settings, $view_id ) { if ( $view_id == 10623 ) { if(isset($_REQUEST['wpv_view_count'])){ $view_settings['pagination']['type'] = 'paged'; $view_settings['pagination']['posts_per_page'] = 9; } } return $view_settings; }
- The above code will help you to enable the pagination dynamically when you apply and custom search filter or pagination and set the posts_per_page to 9 items per page.
On the frontend when page displayed first time it displays all the map markers on the map - you can adjust the marker display and popup as required.
- hidden link
As mentioned, you should add your search filters to the block view on the following page and also add whatever fields you want to display with your loop:
- hidden link
Then also make sure that you should add the same custom search query filters under the "Query Filter" section of the view that displays the maps.
- hidden link
For instance, if you have added the custom search filter for the custom field "Ocena" with your block view then you should also go the the following view that displays the maps:
- hidden link
And under the "Query Filter" section you should also add the query filter for the custom field "Ocena".
For example:
Select items with field: Ocena is a number greater than or equal URL_PARAM(wpv-wpcf-ocena)
OK, thanks a lot.
One more question though. How this way set up map behavior? I mean appearance and marker of user's location.
One more question though. How this way set up map behavior? I mean appearance and marker of user's location.
==>
Well - you can customize it as you want.
Please check the following Doc that might help you:
- https://toolset.com/documentation/legacy-features/maps-plugin/
Hi,
I worked with this for two days and I am very not happy of using this legacy functionality.
Firstly it's pain in ass to customize it, secondly if something will break you will not support it.
Can you do the same using not legacy options?
Well - legacy view is just to display the maps with markers.
The view that displays the post will remain as block version. It's just legacy view that will display the map with marker. Even you can consider removing the map from legacy view and add map block but the markers will be displayed with the legacy view.