Good day.
I have several problems with displaying custom post types in Views (created with Blocks) and their filters.
This view is installed on my website
hidden link
and is supposed to show posts of the user-defined post type "Parking spaces" on a map and in the output in a user-defined archive ("List of parking spaces").
In the output of the view, I installed a sorting according to the distance from the user's location.
The listing refers to the "Address" field
However, the output of the sort does not work correctly. The contributions are not issued in ascending or descending order exactly according to distance.
I ask for help in solving the problems.
Kind regards
Hi, I'll need you to resolve the JavaScript error I mentioned in another ticket first so I can continue debugging the sort order issue here. Please also provide a screenshot of the View editor area so I can see how you have the sorting system configured in the View editor or Blocks editor. Or if you provide login credentials in the speed ticket I can use those to look in wp-admin and see how this is configured.
Hello,
On the subject of "JavaScript errors", I can inform you that the website's theme actually has an integrated time display, which I have deactivated in the theme customizer.
I will temporarily activate the display so that you can check whether the error is still there.
Kind regards
Hello,
I have just reactivated the time display in the Theme Customizer. Please check whether the Js. error still affects the functionality of the website.
Kind regards
Hello,
as requested the screenshots of the filter settings "Search within distance" with sorting.
Kind regards
I have just reactivated the time display in the Theme Customizer. Please check whether the Js. error still affects the functionality of the website.
Yes, the problem is still occurring. One way to resolve this for now is to update the JavaScript file that is producing an error. You can comment out the offending code in /wp-content/themes/newsup/js/custom.js by adding two slashes at the beginning of line 152 like so:
//document.getElementById("time").innerHTML = d.toLocaleTimeString();
Then upload that modified file on your server.
Hallo,
ich habe die Zeile 152 eben auskomentiert.
MfG
Okay thank you, the error I saw repeating has been resolved. Regarding sorting by distance, this feature is only possible in classic Views and has not yet been implemented in the block editor. It is on our developers roadmap, but has not yet been created yet. To use distance sorting, you must use the classic Views editing experience.
Even in classic Views, however, front-end sorting controls do not include distance sorting. You have the ability to use sort by distance in the backend, but there is not an option for creating a front-end sorting control that sorts by distance. Sorting by address field, as you have currently set up your View, is not sorting by distance. It's sorting by address, alphabetically, which doesn't really help you in this case.
Additionally, Relevanssi hijacks search result order in Views that use text search, so distance sorting is not fully supported:
https://toolset.com/documentation/user-guides/views/searching-texts-custom-fields-views-relevanssi/#integration-with-custom-searches
So to recap:
- Sorting by distance is not possible in Views created in the Blocks Editor. Only Views created in classic experience have this feature.
- Front-end sorting by distance is not possible in either Views created in the Block Editor or in the classic experience.
- Relevanssi can have an impact on search results, so be aware of this limitation.
Hello,
it's very annoying that sorting by distance doesn't work. I use geolocation to display the distance in the posts and archives. These values seem to be correct. Why can't you access this value when sorting? I am skeptical about the creation with the classic view. According to Tollset's recommendation, it is not the future. I had already tried the classic view. There are also various problems. For example, the filtering by distance does not work here.
See here: hidden link .
However, this page loads a little faster.
Kind regards
Hello,
I have tried the URL you mentioned above, it seems to be work fine, here is my screenshot: distance-filter-map.JPG
What should the map display? is this problem resolved?
Please let me know if you need more assistance for it, thanks
Hello,
in a classic view (hidden link) you can preset a sorting in the backend which also works. However, sort controls in the backend don't work. With a view created with blocks (hidden link), no sorting works.
Overall, this is unsatisfactory.
Kind regards
I have tried the URL you mentioned above:
hidden link
I get 404 error.
Same as your another thread:
https://toolset.com/forums/topic/problems-with-views-and-filters/
Please provide your website copy in above thread, I need to duplicate the same problem and debug it in my localhost
Hallo, die richtige URL lautet:
hidden link
Die gewünschte Kopie meiner Website werden Sie auch noch erhalten.
MfG
Thanks for the details, it is a known issue, if you order the result by distance in backend, then the front-end sortby will not work, we have a feature request for it, I have added this thread into our to-do list, hope it will raise attention.