3

I have a content type called "orders" and another called "pickups". When I create a new "pickup", I pick which order its associated with it. But when I view my orders I have no way to "reverse" reference this to see which orders have been picked up. I would imagine a reverse entity reference would solve my issue but I can't figure out.

I want to show this information in a view table that displays all my "orders" and on each row show the ones that have a "pickup".

How can I achieve this?

  • I think you can do this with Views. In Views, add a relationship of referencing and not referenced. – No Sssweat May 17 '17 at 22:58
4

You can do this using the EVA: Entity Views Attachment module. You need to create a view of "pickups" using the nid of the current node as contextual filter and the in the Manage Display of your "Orders" content type you will see your view. Take a look to this tutorials:

https://www.ostraining.com/blog/news/eva-module/

https://www.youtube.com/watch?v=0CHC8I9xZIg

EDIT: There are other options creating the view with a contextual filter and using modules like this:

Views Field View

There are a lot of cases in views where you want to embed a list inside each row. One example could be, you have a list of groups, and for each groups you want to list the first and last name of all of their members.

This can be achieved with this module, as views_field_view allows you to embed one view into another view and pass arguments along.

Viewfield

Viewfield provides a field that holds a reference to a View and renders it whenever the entity containing the field is displayed.

| improve this answer | |
  • this is for a single page node. but what if i wanted this information in a view table that displays all my orders and on each row show a the ones that have a pick up. – Patoshi パトシ May 18 '17 at 10:08
  • @duckx You can create other view of all your orders with a view display, or just see my edit. – Adrian Cid Almaguer May 18 '17 at 13:46
  • @duckx any advance? – Adrian Cid Almaguer May 22 '17 at 12:01

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