1

First question, hope I can get some answers. I have this information schema:

Books: Title and Author (Entity Reference field to Books content type)

Author: Name and Books (Entity Reference field to Author content type)

I created a view to show the authors with their ID's. I want to also show in the Books field the ID's for the books that reference them. I already created the relationship and turned aggregation on and asigned it to the books field. The view looks like it's working and aggregation also seems to be working, however, no results are showing in the books field. Any ideas?

I'll appreciate any answer. Thanks!

0

First off, you only need an entity reference field on the content type Books that points to Author in your example. It would be a pain in the long run to manually maintain the two relationships and all data needed to describe your relationship is given in the Book->Author field.

Now let's create a View that lists books.

Views Entity Reference Group by title

(I've removed the second column in the screenshot from Views as no settings were done there)

Add the entity reference relationship under Relationships. Add Content: title and use your relationship. Under Format and Settings, set group by to the Content: Title field you created in the step before.

Now all books are listed and grouped by their author.

In my example I also sort by the authors name. If you rather show the Nid of the content, just switch from Content: Title to Content: Nid.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.