Hướng dẫn xây dựng Business Directory với Drupal 7

Hướng dẫn xây dựng Business Directory với Drupal 7

Over the last couple of weeks, several different OSTraining members have asked me about creating a directory in Drupal.

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.

Hướng dẫn xây dựng Business Directory với Drupal 7

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

media_1403021295428.png

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:

media_1403020812525.png

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:

media_1403021328644.png

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:

media_1403021493870.png

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.

media_1403021569709.png

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

media_1403021792667.png

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:

media_1403025998761.png

And here's a video from our Search class illustrating how to use the Facet API module:

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Manage Photos between Facebook, Google+, Flickr with Primadesk Android App

Manage Photos between Facebook, Google+, Flickr with Primadesk Android App

Some months back we mention about a web service Primadesk ,which allows you to copy and manage photos between Facebook, Flickr

Apple và Samsung sẽ sớm thỏa hiệp?

Apple và Samsung sẽ sớm thỏa hiệp?

Theo cựu Phó giám đốc phát triển của Apple - Jay Elliot, tranh chấp tại phòng xử án giữa Apple và Samsung thực ra chỉ là phần nhỏ trong cuộc chiến chống lại Google của "Quả táo khuyết" và sẽ sớm kết thúc.

Những vấn đề basic của Drupal 8 tại DrupalCon Austin

Những vấn đề basic của Drupal 8 tại DrupalCon Austin

To figure that out, I've mined the schedule for Drupal 8 related talks and events and organized them a bit to help me – and hopefully you – find the Drupal 8 sessions not to be missed.

Công ty diệt chuột T&C

 

Diet con trung