0

I have two node types: book, author.

There is a node reference field in book which references a single author.

On a book node, I would like to display a list of the same author's books, which I don't know how.

It seems to me the solution will involve EVA, contextual filter and relationships.

I can list all the author's books in an author node using EVA and contextual filter. But it uses author's node ID, which is in the url. I don't think I can pass the referenced author's Nid in a book's url. Or can I?

I'm only 5 days into drupal, and don't know a thing about relationships, can someone help me get my head around this? thanks in advance!

[D7]

0

1 Answer 1

1

I can't believe I just did it myself, though not sure if it's the best way.

First add a relationship, Content: Author (field_reference_author), give it a name: field_reference_author

Then add a relationship, Content: Author (field_reference_author) - reverse, set RELATIONSHIP to the field_reference_author, give it a name: field_reference_author_reverse

Set each displaying field to use relationship: field_reference_author_reverse

Add contextual filter, Content: Nid , without any relationship, Provide default value :content ID from url.

To exclude the node that is containing the related nodes list, from the list, just add contextual filter: Content: Nid , with relationship: field_reference_author_reverse, Provide default value :content ID from url.

And it's done!

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