问题
I have two content types - "Blog" and "News". I am using a reference field to relate blog nodes to news nodes. Now, for the news landing page, I need a block view that displays "Related blogs" i.e. it lists blogs that are related to any news node.
The news landing page is a panel page with a main view that lists all news nodes. The "Related blogs" block will be placed below the main block.
Is there a way to achieve this "Related blogs" block using views?
I am using Drupal7 and I am free to use any module for the relations, apart from references.
回答1:
Just create a new view, add the reference field as a relationship, and the NID as the contextual filter. Also set the contextual filter to Provide a default value and choose Content ID from URL. The add the block to your news pages.
来源:https://stackoverflow.com/questions/10025713/way-to-display-those-nodes-in-a-view-that-are-related-to-any-other-node-of-a-dif