Skip to main content

How to Build an Employee Directory

Submitted by jessica on Fri, 03/09/2018 - 20:04

Building a company directory is quite easy with drupal. Here is how I made this simple example directory.

  1. Install and enable the modules: Automatic Entity Label and Token.
  2. Enable the core module: Telephone. This will enable the telephone number to be dialed from a phone, which is pretty convenient.
  3. Create a new content type for Employee and give it the following fields. The data type is in paranthesis:
    • Last Name (text plain)
    • First Name (text plain)
    • Job Title (text plain)
    • Department (select list)
    • Telephone (telephone)
    • Email (email)
    • Floor (integer or text plain)
    • Room number (integer or text plain)
  4. Go to Structure > Automatic Label > Employee
    Automatic entity label configuration
    Choose the second option. The tokens for the label are variables.
    This will automatically hide the title field and make it the first and last names.
  5. Add some employees; at least 1 in each department.
  6. Create a page view and add the fields
    • Last Name (text plain)
    • First Name (text plain)
    • Job Title (text plain)
    • Department (select list)
    • Telephone (telephone)
    • Email (email)
  7. Hide the title and department fields by checking "exclude from display."
  8. Filter for the Employee content type.
  9. Add a contextual filter with the following configuration settings:
    This will sort the view by departments.
    This will sort the view by departments.
  10. Check your view, which is your directory, and enjoy.