0
votes

I've got a main content type: "tournament", and a number of complimentary content types, e. g. "news", "judges", "participants".

A piece of news may relate to one or more tournaments or not relate to any tournaments.

Node type: News
Has field: Relevant Tournament(s)
                ↓
Node type: Tournament

The relation between tournaments and news should be set when creating a piece of news: you write news title, news contents and tick the relevant tournaments. So it's the complimentary node type that has the entity reference field.

On each tournament's page there should be a block that displays news relevant to the displayed tournament.

What i tried:

  • Created a Block View and put it to tournaments' pages.
  • Added a Contextual filter that retrieves tournament's Nid from URL.
  • Added an EntityReference Relationship (either "Referencing or "Referenced").
  • Set Format Style to Unformatted + Rendered Entity.
  • Attached either of Relationships to the Rendered Entity Format Style.
  • Also tried attaching Relationships to the Contextual filter.

But i failed to achieve the desired result.

I found a guide that might be relevant to my issue. But i failed to understand it because it involves PHP-hacking and is very Commerce-specific.

3

3 Answers

1
votes

Okay, i got it figured out.

It wasn't working while i was using the "Rendered entity" Format Style.

When i changed to "Content" format style, it started working.

A complete recipe for reverse Views Entity Reference can be found here: http://drupal.org/node/1724396#comment-6406274

1
votes

You can also check http://drupal.org/project/content_dependency It provides automatic reversed referrals previews of different entity types.

0
votes

Maybe an obvious question/answer:

Did you add a the "Content:rendered node" field to the fields of your view? You can refer to your Entity Reference Relationship (either "Referencing or "Referenced") in this field. This might do the trick.. Otherwise, good luck!