Drupal

Add a List of Related Data to a Node View

The problem is that you have a parent node and a heap of related nodes that you want listed when you look at the parent node view mode. In this case you may have used the “Node Reference” field to make this reference.

For example, you may have a movies database and each movie has a list of actors linked to it. When we look at a movie, it has a list of actors after it. We have the movies and actors as different content types and are using the Node Reference field type to create the link. How do we do this?

As it turns out, there are several different techniques that you can use. Before anything you need to create a view with the data that you require. Then attach this view using one of the following techniques

  1. Create the actors view as a block and set the block setting to display only on the movies content type
  2. Create a movies template override and hard code the actors view into this
  3. Use the “Entity Views Attach” module to link the actors view to the movies content type
  4. Use the “Page Manager” modules (part of Chaos Tools) to define a Panel override and assign the actors view as part of the content

The easiest of these is using EVA and the preferred is probably using the page manager. Individual instructions on each of these will be written later.

Leave a Reply