Views Field View

Tags

This module allows you to use a field in a view that embeds another view. When do you need this? Lets us use an example.

I have a content type 'songs'. Eg. 'Here comes the sun' from the Beatles. Three artists did participate for this song. (Lennon was in the hospital) I present a view that shows the song and its participants, with photo.

Drupal8_001796.png

The content type of the artist has a body and an image field.


Drupal8_001797.png

The content type of the song has a reference field towards the artists.


Drupal8_001798.png

First we start with the view of the artists.Title and image.


Drupal8_001799.png

Then the view of the songs. A title, body and GLOBAL:VIEW This is the module working...

Drupal8_001802.png

You can reference towards an existing view. Mind the contextual filtering from one view towards another. I also give the ID of the artist as link.

Drupal8_001803.png

The field artist has to be an ID field, not the label.

 

Drupal8_001804.png

This ID is captured in the other view following this configuration.

Drupal8_001800.png
Drupal8_001801.png

Using this method, you don't need relations in your view. If you want to show a picture of the referencing content, you need a relation. Now you don't. The selection appears through the contextual filtering.

In the child view you set the contextuel filter to the ID of the node. In the parent view you set the referencing field ID as link. You don't need to set this field visible..

A fine method to avoid relations. One big disadvantage.. You can not filter the fields obtained with this method. Look but don't touch...