Site Building

Movie Project: Use Views Relationships for Drupal 7

Last updated
Categories
Up-to-date with minor version
7.x

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.

In this exercise you will demonstrate more advanced Views skills by building a view with a relationship between content and taxonomy and formatting the output using a table.

Goal

Create a view of content with a relationship to a taxonomy term and format it as a table.

Prerequisites

You will need the following knowledge and skills. If you need a review, check out the Additional resources section at the bottom of this page.

  1. Create relationships within views.
  2. Customize the markup of content within a view.

Wireframe reference

You will need to refer to the wireframe collection PDF.

  • Reviews Index Page

Screenshot of a finished index:

Image

Tasks

Create a view with the URL of reviews, containing taxonomy terms, using Genre as the parent vocabulary.

Use aggregation to allow us to count items within a query.

Create a relationship between the terms and content items they are associated with.

Add fields to display term names and the number of content items which reference that term.

Format the term name to link to reviews/{GENRE}.

Use a table to display the results.

Hints

  • There are many configuration settings required to do this. Check the configuration options carefully.

Recap

  • Relationships between content can be created to enable a multitude of possible scenarios.
  • Different formatting options enable us to present content for a range of purposes.

Further your understanding

Additional resources

Creative Commons License

Drupal Training Resources by Damian Robinson are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at http://www.damianrobinson.co.uk.

Hands-On Exercises: Movie Project