I'm trying to recreate a site, and one part of the content is supposed to show the distance relative to the user's location, like this:
Does anyone know of a way I can accomplish this?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
You need to install the Geolocation Field module and the example submodule that comes with it.
In the examples you will find a view that made exactly what you need, and you only will need to clone and edit the view.
Geolocation Field provides a field type to store geographical locations as pairs of latitude and longitude (lan,lng). The Drupal 8 version also provides a views proximity search plugin. Geolocation Field can be used with all fieldable entities like nodes, users, comments, taxonomy terms, etc.