1

I have a central content type that is being referenced by many child content types. The child content types all have an entity reference field pointing to the central content type.

Now, on the node page, I want to display a list of all the nodes that are referencing this particular piece of content.

It seems I can use Field View to set up a view showing the desired content, and then embed it as a field, but I'm not sure how to pass the value of the currently-being-viewed content to the view in order to make it limit the results properly.

Any advice or other ways to approach this problem?

  • When you say 'Field View' do you mean Viewfield or Views Field View or some other module altogether? From question, I'd guess Viewfield. No extra module may be needed. A common pattern is to set the contextual filter (as @Triskelion) on a Views block and then simply the block visible for that content type, setting the block's region to content and ensuring it is position below your content. This gets the View to appear below your content, without the need for an additional module. – Obliquely Mar 26 '13 at 21:30
  • Yes, I meant the viewfield module, not Field View. Interesting concept using blocks instead, that is a better solution since I wouldn't need to add meaningless fields to my content. – ouni Mar 26 '13 at 21:50
1

In your view set up a contextual filter (under 'Advanced') on the entity reference field. Then configure the filter to provide a default value if the filter is missing. Select 'Content ID from UrL'.

When you display the view, it will list the children which point to the page you are currently displaying.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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