Skip Navigation

[Resolved] Display all directory entries on map but list with pagination

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.

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 6 replies, has 2 voices.

Last updated by Minesh 1 year, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2685272

Tell us what you are trying to do?

I have a directory with a map. The directory listings are displayed 10 at a time using pagination but I would like all of the markers to show on them map, not just the 10 that are listed.

Is there any documentation that you are following?

I have tried following these instructions but they are quite old and it seems to rely on duplicating the view and then editing one of the resulting views - but if I do that it updates both views. https://toolset.com/forums/topic/is-it-possible-to-show-all-entries-on-map-but-the-entries-below-are-paginated/

Is there a similar example that we can see?

What is the link to your site?

hidden link

#2685282

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I would like to know few things here - Lets assume you set 10 results per page, now, when user click on page 2, what is your expect result?
- Do you want to show those 10 results on map or you still want all results on the map?

In addition to that - Could you please send me debug information that will help us to investigate your issue.
=> https://toolset.com/faq/provide-debug-information-faster-support/

#2685283

Thanks for getting back to me. I have included the debug info. In answer to your question:

> I would like to know few things here - Lets assume you set 10 results per page, now, when user click on page 2, what is your expect > result?
> - Do you want to show those 10 results on map or you still want all results on the map?

Yes, I would like the pagination to only apply to the results list, not the map. So, when I click to page 2, I still want to see all results on the map.
But I would like the search filter on the page to apply to the map as well as to the results.

#2685297

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I will require to review your current custom search setup and then I will be able to guide you in the right direction.

Can you please share problem URL where you want to display the map with custom search and pagination as well as admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2685315

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've enable the following view:
- https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views

I've created the following view:
- hidden link

To the above view - I've added the map and marker to the above view that will display the all markers without pagination and it will also respect the search filters as you can see I've added the "Filters" to the "Query Filter" section to above view.

Then, I've removed your existing map block that is no needed.

And I've also set your current view block on homepage "Directory search form" view's custom search setting to "Full page refresh when clicking Submit" as its required to get the value from URL params to filter the above view that shows the map marker.
- hidden link

#2685318

Hi Minesh

That's really great.

I've just spotted a couple of circumstances where it doesn't behave as expected, e.g.

If you use the Distance search and search for results within 40 miles of Sheffield, UK it works perfectly.

If you then change the distance to 10 miles and Submit, the listing correctly updates but the map stays the same.

Is there anything we can do about this?

I'm also going to try this approach to get the page to scroll down to the directory when the page reloads (because we have so much content above that I don't want people to have to scroll through): https://toolset.com/forums/topic/full-page-refresh-when-visitors-click-on-the-search-button-and-keep-position/

Thanks for your help!

#2685421

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've added the following filter code to "Custom Code" section offered by Toolset:
=> hidden link

add_filter( 'wpv_view_settings', 'func_update_distance_radius_from_urlparam', 5, 2 );
function func_update_distance_radius_from_urlparam( $view_settings, $view_id ) {
  
  if ( $view_id == 2056) {
    if(isset($_REQUEST['toolset_maps_distance_radius']) and
       $_REQUEST['toolset_maps_distance_radius']!='') {
       $view_settings['map_distance_filter']['map_distance']= $_REQUEST['toolset_maps_distance_radius'];
    }
    
   
  }
  return $view_settings;
}

More info:
- https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/
- https://toolset.com/documentation/programmer-reference/views-filters/#wpv_view_settings

I can see it works as expected now. Can you please confirm it works as expected.
- hidden link

#2685439

Hi Minesh

Thank you so much for your excellent support. My client is going to be very pleased with the map working as they want it now.

Best wishes
Lucy