OSTraining: How to Use Relationships in Drupal 8

How to Use Relationships in Drupal 8

With the Views module, it is possible to fetch pieces of data from a Drupal entity and display them according to a specific format. The Views module acts as a query builder, which generates the SQL code, in charge of retrieving the data from the database.

The first setting when creating a view allows you to choose the base table from which the aforementioned data will be recovered.

191128 drupal relationships

When you choose Content as the base table, you also have to specify the Content type, so it will not be possible to retrieve data from other content types and present it within the view unless you set a Relationship between those content types.

This tutorial will explain the concept of Relationships in Views with a basic example. 

Let’s start!