0

So for Content Type 'Level 3' I have added a field called 'Related Links' which uses Entity Reference and autocomplete so a user can select multiple pages that are related.

I've been now trying to render these pages as links using Views, however I'm really stuck as to what settings I should be using. I need Views to get the Related Links for the current page on which it is displaying the block, and then display a linked Title of each of the pages that have been specified in the 'related links' field.

1 Answer 1

2

Create a new view showing content, check "create a block".

Click in advanced and, in relationships, add "a bridge to the content entity that is referencing content via your_field_name". The identifier will be something like: "Content referencing Content from your_field_name"

Then add a contextual filter with a relationship to the filter you just created. Select provide default value (Content ID from URL) when filter value is not available.

You can also filter nodes by type to make the view more efficient.

Save your view and add your block to show in the corresponding pages through the block display manager, context or display suite.

4
  • Hey @castaway, what should I be choosing when I 'add a contextual filter'? The list is now populating page links....but not the ones from the related links field :S Commented Nov 1, 2012 at 3:43
  • Hey @castaway, it's doing it the wrong way around....For Page A it is searching the Related Links field for where Page A is specified on other content, then displaying the title of these pages. I want it to take the content specified in Page A's Related Links field and display the titles of these. Commented Nov 1, 2012 at 3:53
  • 1
    Sorry, I must have misunderstood. Did you try using "Content being referenced by your_field_name" instead?
    – castaway
    Commented Nov 2, 2012 at 9:07
  • I'm trying to implement this in 2019. Is this workflow still the same? I cannot get this to work in 8.6
    – blue928
    Commented Feb 27, 2019 at 18:09

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.