When using the search form, by default Drupal searches Content nodes, and there's a toggle to search Users (search/node vs. search/user). But the search/user appears to only search the default fields for the User nodes (username and email). I've added additional fields (Admin > Config > People > Manage Fields) to User nodes, but those don't get searched. How can I make the default search/user find users by those additional fields?
Tell me more
×
Drupal Answers is a question and answer site for
Drupal developers and administrators. It's 100% free, no registration required.
|
|
|||
|
|
|
As far as I know, the easiest way to do this is with views. You can set up a user view with exposed filters for any user field that you need to search. If you want to get a link to your your view on the search page form then, a form alter in a custom module would do it. Obviously make sure your view has a page with a proper path setup. search/your_view etc will work. Here is a quick example of adding a custom markup field to the search form in drupal 7.
That should put a link underneath the search box on the form (after a cache clear). However, I havent been able to figure out how to make it appear only on search/user pages yet so, that link will appear on all search forms. |
||||
|
|