Tell us what you are trying to do?
I've got a members' directory which is on a custom post type. I want to list the members and allow visitors to the website to order by and filter by certain things. I want to know if this is possible.
I want to allow the visitors to order by name and town. I know this is possible.
But I really want to order by distance to a certain location that the user enters. I assume this is possible?
Is it also possible to show the distance in miles or kilometres for each post?
And I'd like to display a map of the members for the current view.
I am using the legacy view builder - not the block builder
I am testing this on a staging server. I only have the town of each member - not the whole address. But this should still give a rough location. On the main site I'll have the address split into different fields (first line, 2nd line, town, city, postal code, country), but I can combine these to one address field if that is what Toolset needs.
I've tried to add a new custom filter, but "distance" is greyed out.
Is there any documentation that you are following?
I tried to follow this article: https://toolset.com/course-lesson/filtering-and-ordering-map-markers-by-distance/
And: https://toolset.com/forums/topic/order-view-by-distance-after-giving-in-current-location/
Is there a similar example that we can see?
What is the link to your site?
hidden link
Hello,
You can sort the result by distance between user entered location, and it needs legacy editor, for example, you can edit the your post view, in section "Ordering", order the results by distance from the custom address field, see my screenshot: sort-by-distance.jpg
And you will need to setup the custom address field by following our document:
https://toolset.com/course-lesson/installing-toolset-maps-and-adding-address-fields/
Thanks so much, that screenshot and article really helped. I think I am almost there.
But I am getting confused as to how I add a field that the visitor can enter a location in to order the list by distance from.
Can you explain how I can do this?
I tried to look at this page: https://toolset.com/documentation/legacy-features/maps-plugin/filtering-and-ordering-map-markers-by-distance/
But it looks like it's focused on the block editor, not the legacy editor.
Is it also possible to have the option of ordering by the users' location as well (as it shows in that article).
Thanks!
In the legacy editor post view, section "Search and Pagination", you can find the button "New filter", and add the "Distance" filter field.
If you don't see section "Search and Pagination", please click link "Screen Options", enable option "Search and Pagination"
Thanks, I did notice that before. But unfortunately, it's greyed out.
I am not using the distance filter in the search and pagination section.
Any ideas as to why it's greyed out?
I suggest you try to create a new post view, and test again, there might be some wrong settings in the old post view.