Add a related list using Blocks

Suppose we want have a Movie’s Database that uses the “Node Reference” module to link Actors to the Movies they are in. And when we look at the Movies Node View Page, we want a list of Actors they have been linked to as a table at the bottom. And we want to do this via Blocks.

In Drupal 7, the solution is very simple. These instructions have essentially been copied from here.

Step 1: Create a View

  • Create a View normally with a “Block” display.
  • Add a Contextual Filter. Provide a “Default ID” and choose “Context ID from URL” as per image

and now specifiy a filter

Step 2: Display the Block

  • In Structure -> Blocks, display the block as normal
  • Choose Configure and select the Content Types to display this blcok with. In the example stated, “Movies”

Leave a Reply