In Views, how can I "group" by a node/entity reference field? (So the referencing "parent" entity is displayed first and any referenced "children" entities are displayed after?)

• By "Attendee" I am referring to the parent in the reference.
• By "Friends of Attendees" I am referring to the children in the reference.

  • I am rendering Name Tags for thousands of nodes in one content type called “Cadet.”
  • Each of these "Cadet" nodes specifies a single "Attendee" for an upcoming event.

The situation:

  • Some attendees also need name tags printed out for their “friends” who are attending "with them."
  • To link these "friends" to the Cadet nodes they are attending with, I used an Entity Reference field: enter image description here
  • entity reference field

The sorting order / grouping problem:

  • When rendering the view, I need these “friends of attendees” to appear “right after” the attendee they are going with.

The final question:

  • How can I get the Views module to sort the friends of attendees (children) "right after" the attendee (parent) they are going with? I am assuming there needs to be "grouping" rather than "sorting"... and a relationship might also be necessary. After three days of trial and error on this one, I cannot figure it out. Any help would be VERY appreciated!

Here are my current settings all in one PNG if that helps

I am technically using the Views PDF module, but it has the basic Views functions, so if it's possible with Views, it will probably be possible with this module.

CommentFileSizeAuthor
#2 order_proposal.png303.51 KBownage
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ownage’s picture

Issue summary: View changes

embed pic

ownage’s picture

Issue summary: View changes

sdsad

merlinofchaos’s picture

Status: Active » Fixed

You probably actually want to use the views_field_view module and basically combine two views into one, where one view loads the entities and the inner view loads the referenced entities per node.

ownage’s picture

FileSize
303.51 KB

Thanks for the reply! Either I'm doing something wrong or the barely maintained "Views PDF" is not compliant with the "Views Field View" module. Views PDF has its own display type (which exports to .PDF) and it seems to be rendering as a plain white PDF when a "View Field" is added.

Would you happen to know of any alternative ways to sort in this fashion? Maybe within Views itself? Constant troubleshooting has lead me nowhere so your help is very appreciated.

Here's a before & after mockup of what I'm trying to achieve:

order proposal

merlinofchaos - btw, one last thing - let me just say that it's an honor to have you assist in this support request issue. I haven't used Drupal too terribly long, but I've seen your name all over the place and just wanted to voice my extra appreciation for your time and effort within the Drupal community. Thanks again!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

dfsdf