0

So this is what I'm trying to do in Drupal 6:

Node type A is video, node type B is a person Nodetype A has a reference field where you can enter a reference to any Node from nodetype B

how can I create a block view which will be displayed on nodes from node type b, which will show all the nodes from node type A where the current node from node type B is referenced?

1

Simplest way would be to make references two-way. To do this, use:

That way, current node will reference all nodes that reference it - and from this point creating a view is trivial - or you can simply display the field created for back reference, without need for a views module at all.

Other way is to use Views. Create a view displaying nodes from content type A, add argument content reference field > provide default argument > node ID from URL and display this block view on the nodes from content type B.

  • 1
    This does work, but I am pretty sure CNR requires each content type to have a noderef field on it, which it then keeps in sync. – mpdonadio Oct 9 '13 at 13:23
  • @MPD yes, it does. But the field only needs to be there, it does not need to be displayed. And the fact it's just a normal field from the point of view of other modules makes it so easy to work with, ie to use Views on it. – Mołot Oct 9 '13 at 13:24
  • Thanks, but it seems like I would need to create new nodes for Corresponding node reference to work. I already have plenty of nodes from nodetype A which reference nodes frome nodetype B, so I would prefer a solution where I could create a view based on the existing references – Lieutenant McClane Oct 9 '13 at 13:25
  • @LieutenantMcClane not new nodes, just new non-displayed field on existing ones. But I understand you prefer to avoid that. The point is, at least for Entity Reference feature request for this functionality was closed in favour of Corresponding Entity References... It does not mean it's impossible to go another way, of course. – Mołot Oct 9 '13 at 13:28
  • @MPD in addition to my comment above you wasn't notified about, I wanted to ask how can you imagine going without another field? Full scan of all nodes each time list is refreshed? Everything else seems to require some storage for "the other way" and I don't see how a field on the other end is worse than any of the alternatives. (My question is not rhetoric one, I would really like to know, maybe I'm missing something). – Mołot Oct 9 '13 at 13:47

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.