Allow setting proximity exposed filter manual origin default value with context tokens for more dynamic views

Created on 30 April 2021, over 3 years ago
Updated 16 October 2023, 12 months ago

Problem/Motivation

I want to configure proximity filtering to a view based on the context of parent node, but the only way to set a default origin from the geofield is a fixed lat/lng pair entered manually in the view. This makes setting a default origin value too inflexible for a general purpose view. At the moment I am replicating a single view only only to change the origin in the proximity exposed filter. I plan to have hundreds of nodes so a matching number of views is not a good solution.

I am referencing the view from a node as a viewfield which means I have all the context of the node available in the view but I cant use it as there is no way of accessing it from a view and passing it to my filter to dynamically set the proximity origin from the node context.

Steps to reproduce

Create a view of nodes with a geofield and add an exposed proximity filter.
Configure the filter to default to specified value.
Note there is no way to make the value dynamic it has to be hard-coded.
Note that the default value does not support tokens.

Proposed resolution

Ideally I would like to be able to set the value from a token not only a string: Views|Add filter|geofield proximity|Proximity Definition Mode| Manual Origin|Default. This would save duplicating identical views just to change the origin value.

Remaining tasks

User interface changes

API changes

Data model changes

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom Syntapse

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States fehin

    I'm trying to do something similar. I want to set the origin coordinates in the proximity filter to the Geofield field from the current user's profile.
    How did you use the URL arguments for the exposed filter?

Production build 0.71.5 2024