Using Views with the Entity Reference module in Drupal 7 - Daily Dose of Drupal episode 151

CodeKarate · 30K views · 2014 · 21:50

Open on YouTube

Web developmenttutorialdated

Why Drupal Answers Stack Exchange recommends it

Drupal Stack Exchange answerers point people to it when someone needs to build a view that pulls in fields from referenced or related content using Entity Reference relationships and contextual filters.

Recommended by 4 people across 4 different months, 2014 to 2016.

What it is

A 22-minute screencast from CodeKarate's Daily Dose of Drupal series showing how to build Drupal 7 Views that display content related through Entity Reference fields. It walks through creating the reference fields, using Views relationships and contextual filters, and adding an exposed dropdown filter on a reference field.

What people said

Recommends harshal · 2014-08 · Drupal Answers Stack Exchange · on “How can I create a new content by adding another two contents of same content type?”

Entity Reference Module [LINK] should be used for such cases To use the entity reference field in views you should follow the link given below [this video] [LINK] In the advanced section of views you have a relationship option where you will get an option to use a referenced entity for the view of content type A(student).

Recommends Sugandh Khanna · 2015-09 · Drupal Answers Stack Exchange · on “Creating a view that uses fields from two content types”

Best way is to use entity reference [LINK] Below is the youtube link which will provide you step by step explanation of using entity reference module with views. [this video]

Recommends H.Saraf · 2016-02 · Drupal Answers Stack Exchange · on “Entity Reference multi value fields, filter on parent”

I am not very sure what you want to achieve, but you can approach it in 3 ways: you can display members like any other field on family page; you can create a block listing members on family page (or any page where you can provide family node id as contextual filter); you can create a drop-down of family node titles and select the select the family and corresponding list of members would appear. For the first situation you don't need views, you can do it with field UI: Goto Content Types > Family > Manage Display> Set Entity Reference field format to Rendered Entity For the second situation, you will have to create a block view ; his page has detailed instructions: [LINK] For the third situat

Recommends Mupe Rocks · 2016-11 · Drupal Answers Stack Exchange · on “How to create a view showing content linked with an entity reference field?”

OK, finally worked out how to do it. Thanks to this video which explains it all: [this video] However, in case anyone else is stuck you need to first create a relationship based on your entity reference field, sthen create a contextual filter using node:id based on url. This is all you need to do.

Recommends Mupe Rocks · 2016-11 · Drupal Answers Stack Exchange · on “How to create a view showing content linked with an entity reference field?”

OK, finally worked out how to do it. Thanks to this video which explains it all: [this video] However, in case anyone else is stuck you need to first create a relationship based on your entity reference field, sthen create a contextual filter using node:id based on url. This is all you need to do.