Score:2

Changing how to group by

cn flag

So I have a content type, "Person," that uses an entity reference to assign each Person a Program. I'm trying to make a "People" page for my site that groups the people by said program that they are in (ex. Human Resources, Engineering, Design, etc. etc.)

Screenshot of Grouping By in Drupal View

I've done this by grouping by Program in my View. This then spits out a header for each program in the list. That works just fine! However, some folks belong to multiple programs. What my View does then is title the header with each program. For example:

Human Resources:

  • Thad Cleveland
  • Duane Minor

Engineering:

  • Oren Sok
  • Elaine Welton

Design:

  • Tameka Radebaugh
  • Callie Smith

Engineering, Design:

  • Carlyn Beres
  • Pauline Polite

Instead I'd like it to keep each program separate and display the names twice if it needs to. Like this:

Human Resources:

  • Thad Cleveland
  • Duane Minor

Engineering:

  • Oren Sok
  • Elaine Welton
  • Carline Beres
  • Pauline Polite

Design:

  • Tameka Radebaugh
  • Callie Smith
  • Carlyn Beres
  • Pauline Polite

How can I go about configuring the view to do this?

sonfd avatar
in flag
I think if you go to the field that you're grouping on (under Fields in the View UI) there are options for how it should deal with multiple values. I think you currently have it set to show all values in the same row, but you should change it to show values in separate rows.
in flag
I think you want to enable aggregation and use Group By.
khadidja avatar
cn flag
@sonfd Ah, but I've discovered that my issue is is that I'm using the Search API and my view is pulling the content from an index. I need to use the Search API as my view relies on faceted filters. Is there a way to keep the fields with multiple values from grouping together with the Search API then? I've found this but it has to do with Drupal 7: https://www.drupal.org/project/search_api/issues/2705983
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.