I need to add location field to profile. So that any user could filter posts from the same location.

I would appreciate any suggestions regarding to how to add fields to user's profile.

Comments

nevets’s picture

Not sure what's available for Drupal 8. In Drupal 7 I would start with the address module and probably add a geofield.

sam moore’s picture

Go to /admin/config/people/accounts/fields and you can add fields to the user's profile.
If you want a somewhat sophisticated address field setup, you can install the Addressfield module (https://www.drupal.org/project/addressfield) - or just add individual fields for each address component.

If you want to get fancier with user profiles, have a look at the Profile2 module (https://www.drupal.org/project/profile2).

engin’s picture

Your answers fills me in :) Sorry I have been strugling how to add commerceguys/adressing library on my drupal file structure.

So far I have tried:
/libraries/commerceguys/adressing
/sites/all/libraries/commerceguys/adressing
/sites/all/modules/commerceguys/adressing

but none of them worked :(

nevets’s picture

Not sure what you are referring to but I suspect it is a module and not a library.

engin’s picture

  1. I downloaded http://ftp.drupal.org/files/projects/address-8.x-1.x-dev.tar.gz from https://www.drupal.org/project/address/
  2. I enabled the Adressing module than click "install" button then it gives error message
  3. (x) Address requires the commerceguys/addressing library.

  4. then don't know where to put addressing library from https://github.com/commerceguys/addressing
engin’s picture

Cannot install the module. geolocation is not satisfy as it only provides langitude and longitude informations.

nevets’s picture

engin’s picture

it is a shared hosting I cannot run codes

nevets’s picture

If you read through the comments, there is one about doing the steps on development setup and copying the resulting files over.

engin’s picture

Now , how do I filter results based on users profile geolocation field . e.g. proximity

sam moore’s picture