Using Drupal Chapter 5: Product Reviews

This page is archived

We're keeping this page up as a courtesy to folks who may need to refer to old instructions. We don't plan to update this page.

With so much information, and so many products, on the web today, people often want to get an opinion to help rank and rate things. Should I buy this widget? Should I watch this movie? In this series, we're going to use a handful of Drupal modules to build a product review website that lets community members give their opinions, along with a way to rate their review as well. To kick things off, in this lesson we will review the Super Duper Chefs case study and discuss our implementation. This series is based on the Using Drupal, 2nd Edition book by O'Reilly Media, and uses the source code provided for that book.

See our guide Using Drupal Book by O'Reilly Media to access all of our tutorials related to this book. Each series covers a chapter (or appendix).

Tutorials in this course
More information

With so much information, and so many products, on the web today, people often want to get an opinion to help rank and rate things. Should I buy this widget? Should I watch this movie? In this series, we’re going to use a handful of Drupal modules to build a product review website that lets community members give their opinions, along with a way to rate their review as well. To kick things off, in this lesson we will:

  • Review the Super Duper Chefs case study
  • Discuss our implementation

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

To get started, we'll need to create a content type to use for our product reviews. Based on the Super Duper Chefs requirements, in this lesson we'll: 

  • Create the Product Review Content Type
  • Add a Field group
  • Set permissions

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

Amazon.com is one of a large number of web-based businesses that have opened up their product information databases for other sites to access. In the case of Super Duper Chefs, we want to retrieve useful data like product photos, pricing, and manufacturer information for display on our own website. The Amazon module for Drupal allows us to do just that. In this lesson we'll take a look at the Amazon module, by starting with:

  • What’s Included?
  • Locale
  • Referral settings
  • Amazon keys

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

In a previous lesson in this series, we set up a content type for our product reviews. Now, we’re ready to add a field to store a link to the product on Amazon.com. In this lesson we'll:

  • Enable and configure the Amazon module
  • Get our Amazon key
  • Add the Product Field

Note that Amazon changes the way they manage keys over time, so the way they are generated in the lesson may have changed. Please review the official AWS Product Advertising API documentation for current key generation instructions.

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

Giving visitors a chance to evaluate and rate content is an extremely common pattern on content-rich websites. In addition to giving visitors a way to jump to the best content, it can give you a way to determine what content on your site is most effective. In this lesson we'll discuss:

  • Voting API module
  • Fivestar module

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Voting API module

Fivestar module

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

For the Super Duper Chefs site, we’ll be using both of the Fivestar module’s unique features: adding a static Rating field to the “Product review” content type for the editors to use, and attaching a voting widget to the comment form on each review for the site readers to use. That approach will keep the official rating on each review separate from the reader ratings. In this lesson we'll:

  • Add the Product Rating Field
  • Add the Reader Rating Field

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

Drupal’s theming system gives designers complete control over how a site’s content is rendered for a web browser, and custom themes can give any site a distinctive look. But sometimes it’s useful to make minor tweaks to a site’s appearance using nothing but CSS rules. They allow designers to tweak font sizes, colors, and so on without altering the underlying HTML that defines the site’s structure. In this lesson we'll look at:

  • CSS Injector module
  • Explain how this works

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

CSS Injector module

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

Although our “Product review” content type has all of the data we need, the individual reviews still look a bit untidy. In this lesson, we’ll do some final tweaking to make the review display look nice and tidy.

  • Setting Field Display Options
  • Configuring CSS Injector

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

Now that we have a few products, we really ought to add a listing page that lets visitors look over all of the products that have been reviewed, comparing official ratings with visitor ratings and sorting by various criteria. This is a perfect job for Views. In this lesson:

  • Create a Product Finder view
  • Display Amazon information
  • Display voting results

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

Drupal’s built-in Search module offers powerful, flexible searching features and intelligent ranking of results. Behind the scenes, it’s silently building an index of all the words used in the site’s content. In this lesson we'll:

  • Review the Search module settings
  • Explain the importance of cron
  • Discuss searching with Views

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

To transform the Product Finder page into a searchable index, we’ll be adding two new filters to the view: one that restricts the results by manufacturer, and another that restricts results to reviews that mention specific words. In this lesson, we'll:

  • Add a filter
  • Expose a filter
  • Set permissions

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

We’re almost done! The only problem with our view now is that clicking the titles in the view links to Amazon.com instead of to our own website. Fortunately, Views provides a handy trick for just this sort of situation; we can “rewrite” the output of the Title field to create a link back to its referring node instead. In this lesson, we'll:

  • Exclude a field from display
  • Rewrite the output of a field

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

You've built the site that Bob and Sarah need to get their reviews going, but as always, there are ways to add more neat features. In this lesson, we'll look at a few modules you can look at adding down the road

  • AdSense
  • Display Suite
  • Blog (core)
  • Recipe

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

More information

We’ve hit all of the major pieces of functionality that Bob and Sarah wanted. In this summary, we'll:

  • Tour the Super Duper Chefs site
  • Discuss our implementation points
  • Review modules and resources

Additional resources

Using Drupal, 2nd edition

Using Drupal source code

Drupalize.Me Guide: Using Drupal Book by O'Reilly Media

Up next: Using Drupal Chapter 6: Event Management

This course appears in the following guides:
Site Building
Drupal 7 tutorials related to the Using Drupal book, 2nd edition, published by O'Reilly Media

Using Drupal Book by O'Reilly Media