- Issue created by @fehin
- Status changed to Needs review
about 1 year ago 11:52am 19 October 2023 - 🇮🇹Italy itamair
@fehin ... it looks to me that this previous existing issue (yet containing both "proximity" and "filter" in its title) would help you with the proper approach: https://www.drupal.org/project/geofield/issues/3211644 ✨ Allow setting proximity exposed filter manual origin default value with context tokens for more dynamic views Closed: works as designed
And more specifically this comment of mine should redirect to the parent one: https://www.drupal.org/project/geofield/issues/3211644#comment-14091046 ✨ Allow setting proximity exposed filter manual origin default value with context tokens for more dynamic views Closed: works as designed
It looks to me you should apply the same approach described there but at the user entity (instead of the node one).
And it looks the views_argument_token → has now direct support for Drupal 10 ...
All sufficiently clear on this?
- 🇺🇸United States fehin
Thank you for your response. I have tried the Views Token module, but I don't know how to use it. I have a "user ID" contextual filter that I use to exclude the current user from the search result. If I add the Geofield proximity and use a token for the default value, how do I set up the URL for this second contextual filter? I currently have my URL like this
user/%user/profile-search
. Do I need to add anything to the URL for the Geofield proximity token to work? Also, I noticed the distance is added to the token ([user:field_user_geofield:lat],[user:field_user_geofield:lon]<=25mi
) but I want to expose the distance so people can adjust it to their preference.I have attached images of how I currently have my views set up. It does not work properly, it returns all users, even those without Geofield.