Drupal 7 User Directory

  1. Make sure you have installed and enabled Views (and Chaos Tools).
  2. Configure your user form with any additional fields you want by going to admin/config/people/accounts/fields. In my example here, I used Job Title, Location and a field for Full Name, so you can use that instead of the Username in the view, since usernames are often abbreviations. Thinking ahead, consider if you would like any of these fields to be exposed filters on your staff view. Because I want people to be able to find staff based on their job title or location, I made those fields select lists instead of plain text fields.
  3. Add your users at admin/people/create. Once created, edit the user to add a photo and fill in the additional information. (You can expose the additional fields to the User Create form too. Depending on your site, you may not want all those fields on the initial registration page so as to not overwhelm new users, if they are the ones filling out the form.)
  4. Now let's create the View: admin/structure/views/add. Show Users, create a Page, and give it a path so you can find it.
  5. Set the Format to Grid* and Show Fields. Select the fields you would like to expose. I've selected User: Picture, User: Full Name, User: Job Title, User: Location, in that order.
  6. Choose your Sort Criteria. If you want to sort by last name, you may need to create another field for just the last name, or redo your fields to include first and last names as separate fields.
  7. In the Advanced area, I have enabled "Exposed form in a block", so one can place the filters in the sidebar, as opposed to at the top of the view.
  8. Save your View, and visit the blocks page to position your Exposed filters block in the desired region. Also, edit your block so it only appears on that View (and perhaps on user pages).

drupal 7 staff list

And that's basically it; it's ready for theming. The one tricky part is that Drupal 7 still uses an odd image field for the user picture that is not configurable with Image Styles (although it seems to default to the thumbnail Image Style), the core replacement of ImageCache for Drupal 7 (both for the User page and for Views.) In that case, we'll need to theme them manually with theme_image_style()** in your user-picture.tpl.php file. If you want the staff view to have a different size, find the Field User: Picture tpl information under Theme: Information in the views configuration and theme it from there.