Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple address / locations on a directory entry #333

Open
andybroomfield opened this issue Jan 5, 2024 · 3 comments
Open

Allow multiple address / locations on a directory entry #333

andybroomfield opened this issue Jan 5, 2024 · 3 comments

Comments

@andybroomfield
Copy link
Contributor

Is it possible to have multiple locations on a directory entry.
We've encountered an issue where we enabled this, there where a few oddities.

  • On the entry, there are multiple maps (one for each location). I assume this is becuase as Geo entities they are just rendering the geo display. So perhaps a field formatter that loads the map in a view.
  • On the channel, only the last location shows on the map.

See also localgovdrupal/localgov#446

@ekes
Copy link
Member

ekes commented Jan 5, 2024

We're doing this on the Greenwich directory:

By default directory entry itself does have a separate map per location, it is possible to replace this with a view or other custom leaflet map to show them on one. We could make this the default, as it would also work with one location too.

There is an issue where the view as configured doesn't support multiple locations consistently. Changing the view fixed it https://gitlab.com/rbgreenwich/dev/gcd/gcd-drupal/-/merge_requests/152 I think I was going to push this to directories (for new installs at least) I'm guessing I might not have yet?

@andybroomfield
Copy link
Contributor Author

@ekes Thanks, that sounds good and should work for our approach too.
One this is the geo entitiy fields are still needed if they exist on the Geo, BHCC uses a pseudo fields approach beacuse we need to get them seperatly, but this might be an issue for those that use them (the location, the address and accessbility field).

@andybroomfield
Copy link
Contributor Author

We solved this somewhat by:

  • Using the EVA module to create a Leaflet view that takes the entry as an argument and so displays a single map of the geos for that entry
  • With a bit of reverse enginering of the linked Greenwich MR, adding location entity as a string to the directory search index, and then removing the location relationship from the channel view, instead using the location field as the basis for the map.

These changes appear backwards compatible, so it would be good to incorporate them into the module as default.

ekes added a commit that referenced this issue Jan 19, 2024
This removes the requirement for an entity load of the geo entity.
It enables the possibility to show multiple locations per directory
item as #333.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants