Check your version

This tutorial covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Last updated February 16, 2017

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.

Objectives and Prerequisites

You will need the following knowledge and skills. If you need a review, check out the 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

Movie Review Screenshot

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.

Summary

  • 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.

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.