Skip Navigation

[Resolved] Sort with a dynamic attribute the address field

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

This topic contains 3 replies, has 2 voices.

Last updated by milanV 3 years, 10 months ago.

Author
Posts
#2330723

I want to sort a view directly using its parameters.

Explanations:
The page displays posts by location, based on a radius set in the view filter.

The problem is that the posts are not sorted by distance from the mapcenter.

I need the view to be sorted by the same value as mapcenter (which is used to define the posts to display)

Sorting works fine when I choose a location manually (fixed). I would like this location to be the same as the one defined in the "mapcenter" filter. I tried to insert a shortcode but it didn't work.

Do you have a solution for this?

Best thanks for you help again 🙂

#2330965

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Please see the linked erratum about this known problem, which includes a workaround: https://toolset.com/errata/cannot-order-results-by-distance-in-views-created-with-the-block-editor/

The relevant setting is missing from the block editor and we have an internal ticket to add it.

#2331077
téléchargement (11).jpg

Hi Nigel, thanks for you answer
Im using legacy view editor
My page is not a result page. Is a "normal" page .

It's an archive page (city) in which I want to show only the professionals of this city using my view.

The code in your link doesn't work (maybe because I 'm using mapcenter with shorcode and not an url parameter?)

I would like the order to be defined by the mapcenter attribute.

Best thanks

#2331089

My issue is resolved now. Thank you!

I found the same question here :
https://toolset.com/forums/topic/sorting-views-by-distance-to-current-post-geolocation/

And it works very good !!

Have nice day