0

I have two custom content types, Speaker and Presentation. Each speaker can have many presentations. I am using the EntityReference module to attach a Speaker to a Presentation. Using Views, I would like to create a page of Presentations that also lists the Speaker associated with the presentation such the page would look something like:

Presentation 1
details
Attached speaker details


Presentation 2
details
Attached speaker details


Presentation 3
details
Attached speaker details


How do I do that in Views. I followed the EntityReference documentation but it only talks about creating a block for a single node. I want to be able to show multiple Presentation nodes on one page using Views and EntityReference. Thanks in advance for any help anyone can provide.

1 Answer 1

1

I assume that you have your entity reference field (pointing to speaker) on the content type "Presentation" below and that it is called "field_speaker".

In Views add a new View. Choose Show:Content (nodes), of type: Presentation.

Now you have all your presentations listed, with their titles. Let's leave it at that for now.

Open up Advanced to the right and open up Relationships, choose "Entity Reference: Referenced Entity - A bridge to the Content entity that is referenced via field_speaker".

Now we have the same result as before but we will be able to fetch data for the speaker through the relationship in the content type Presentation.

Under fields, click add and add the field called "Content: Title", now you have a dropdown that says "Relationship". Choose the only on available (field_speaker). Click apply.

You now have each presentation listed with it's title and the title of the presentations speaker.

Now you can go ahead and add the fields you wanted, sort the list etc.

1
  • Thank you so much, Pontus!! Exactly what I was looking for.
    – Kamal
    Commented Jul 31, 2013 at 4:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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