0
votes

I want to search users from a list of users by selecting taxonomy. and also I wanted to add taxonomy field in users profile/registration form.

Suppose I have different taxonomy like "Technology","Eduaction","Stocks" then by clicking on any of this I want the list of users who had selected the same taxonomy.Please suggest solution. I am extremely new to Drupal and also I am not a PHP programmer. I am using Drupal 7

1

1 Answers

0
votes

To do that you need to download and enable following modules: Views, Chaos tool suite, Pathauto and Token.

And then follow steps below (I will assume that list of users on the particular tag will have URL like site.com/user-list/n where n is id of the term):

  1. Create a new vocabulary (Structure/Taxonomy/Add vocabulary). Do not add any terms yet!

  2. Add new alias pattern for your terms (Configuration/Search and metadata/URL aliases/Patterns/Taxonomy term paths). Pattern for "Pattern for all [Your vocabulary from step #1)] paths" should be user-list/[term:tid]

  3. Now you can add new terms (Structure/Taxonomy/add terms).

  4. Go to Configuration/People/Account settings, tab "MANAGE FIELDS". Add new field with type of data to store "term reference". While saving this field choose "Display on user registration form."

  5. Now it's time to create a View, because basic term output works only with nodes. So, Modules/Views/Configure/Add new view. Change "Show: " from "content" to "users" and press "Continue & edit".

  6. On the View's page you should set "Page settings Path:" to user-list and create a contextual filter (Advanced/Contextual filters/Add). You should add "User: [You vocabulary] (your_vocabulary) Appears in: user:user." filter. Now you can save the view. Notice, that in that state only users' names will be listed, if you want to add avatar and so on, you should add specific fields to your view besides "User: Name".

Now it should work just fine. Hope it helps.