Say I create a book database (content type), which has an entity reference field to a separate author database (content type). I can now link all books to a specific record for their respective authors. Great. 

But is there a way to automatically show all books linking in to the author record on the page for the author?

Comments

indigoxela's picture

is there a way to automatically show all books linking in to the author record on the page for the author

You can do that with Views, for example. Not sure how familiar you are with that core module.

Create a block with a contextual filter on the "author" node ID, and based on that relationship get the book node IDs. Put that block in the layout in use on "author" pages.

Create a block with a contextual filter on the "author" node ID, and based on that relationship get the book node IDs.

Thanks! I think I get the general idea. 

I set up a block, which shows (at the moment) everyone’s books on the author page. I also found the contextual filter area in the view for this block. But that’s where it stops. I don’t know how to set up a filter which would dynamically limit the output of the books to the ones who have a (entity reference) link to the author currently being looked at. 

There are a few ways to achieve the outcome, but it does depend on how you want the page displayed.

You can also use the Views module to create the Author page, select the author fields you want to display... similar to the above...

Then use the "Attach" to add a list of books below the Author details.

If you can provide more details, I'm sure we can help you build the page.