Score:0

related by entity reference module views in Drupal 9

id flag

I have two content types:

Company:

  • body
  • field_events (Entity reference)

Events

  • body
  • field_company (Entity reference)

I have created a view that has this setup:

View Settings:

Fields:

  • (field_events: Content) Content: Title

Filter Criteria:

  • Content: Published (= Yes)
  • Content: Content type (= Company)

Contextual Filters:

  • (field_events: Content) Content: ID

Relationship:

  • field_events: Content

enter image description here

I have followed the instructions from: Related block by entity reference

My goal is to display similar events from the same company but excluding the current event shown in the page.

What step am I missing?

Thanks!

Score:2
vi flag

Follow the steps and let me know if you face the same issue

  1. Click on the "advanced" tab.
  2. Click on add under "contextual filters".
  3. Choose Content:nid.
  4. Under "when the filter variable is not available, choose "provide default value".
  5. From the drop down menu select "content id from url".
  6. Scroll all the way down to the bottom of the window and click on the "More" link.
  7. Click "Exclude"
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.