Submitted by admin on Wed, 09/11/2019 - 15:29

Image removed.

I'm going to recommend a 4-step process for creating a basic directory.

Using default Drupal, plus the Display Suite and the Search API modules, we can create almost any type of directory.

Step 1: Create the Content type

First we need to set up our content type for the directory.

In this example, I'm going to build a business directory.

I'm going to create one content type for all our businesses. However, if the different items in your directory require radically different fields, you might consider creating multiple content types.

Image removed.

The image below is an example of the fields added to this content type:

Image removed.

The final field, "Type of Business" is a taxonomy. I've set this up as a Taxonomy to give me maximum flexibility in the future:

Image removed.

If you're taking submissions from the public, read our article "Clean Up the Drupal Content Form" which shows you how to make it easier for new Drupal users.

Step 2. Import Data

You will need to get some data into your site so that you can build the directory. You have at least three options here:

  1. Manually enter the business data
  2. Use the Devel module to generate dummy data
  3. Import data from a CSV file using the Feeds module

In this example, I used the Devel module to create some "Lore Ipsum Dolor" businesses:

Image removed.

Step 3. Improve the Directory Pages

Once we have content loaded into our site, we can browse and see our directory starting to take shape.

However, by default, all of the individual pages will look fairly plain. For example, here is the page listing all the bakers in our directory:

Image removed.

One way to improve the display of these pages is with the Display Suite module. You can watch our full class on Display Suite by clicking here.

With Display Suite, you can control the layout of the page seen above by controlling the Teaser format.

Image removed.

In the example below, I used Display Suite to change the layout to a 3-column design:

Image removed.

Step 4. Filters with FacetAPI

One final step towards creating a good directory is adding powerful search features.

We recommend using the Search API and Facet API modules. Click here to see our full class on creating powerful search with these modules.

Here's an image from Wunderkraut of a faceted search created with the FacetAPI module:

Image removed.



 

Solutions Img