views:

26

answers:

1

I have 2 custom type made with CCK :

  • Reunion
    • Title
    • Description
    • Node reference to Guests (multiple)
  • Guests
    • Name
    • Picture
    • Biography

In Reunion I have a multiple node reference to Guests. (I can have multiple Guest in Reunion).

I would like to print (using views) like this :

Reunion 1
 Description of the reunion 1
 Guests :
  * Guest 1
  * Guest 2
  * Guest 3

Reunion 2
 Description of the reunion 2
 Guests :
  * Guest 2
  * Guest 3

But the only way to print through views seems to be

Reunion 1
 Description of the reunion 1
 Guests :
  * Guest 1
Reunion 1
 Description of the reunion 1
 Guests :
  * Guest 2
Reunion 1
 Description of the reunion 1
 Guests :
  * Guest 3

Reunion 2
 Description of the reunion 2
 Guests :
  * Guest 2
Reunion 2
 Description of the reunion 2
 Guests :
  * Guest 3

I have of course tried the Distinct option in the view parameter, but unfortunately, it only show me

Reunion 1
     Description of the reunion 1
     Guests :
      * Guest 1

Reunion 2
     Description of the reunion 2
     Guests :
      * Guest 2

And apparently skip the other Guests after the first one. Is there any simple solution ?

Thanks !

A: 

Try node:distinct and "group multiple values"

Edit: Ok, this made me curious, so I tried to recreate your scenario:

node type 1: Reunion Fields: Title(default Drupal), Description(textfield multiple rows), Guest (nodereference to Guest, multiple values)

node type 2: Guest Title (used as name - otherwise you'll have to use relationships to show other fields), other fields.

Then create View of type node In the defaults, choose Style - Unformatted, Row Style - Fields. Add fields Title, Content: description, Content: Guest (as link to node). Make sure that Group multiple values option is checked for Guest field (it's enabled by default but I actually had to recheck it to make it active). In the Filters choose Node: Published and filter by Node Type = Reunion. Run preview to see if it's working (it should).

Now create Page View and give it path "reunions". If you go to path "reunions" it should be working as required grouping multiple fields together.

friendlydrupal
Sadly, won't work, because it will group under the Title, but the description of the reunion will still be duplicated many times...
TheSquad
In fact I found the solution yesterday. You are right, we can't use relationship, you must print the Guest node directly, and group them.
TheSquad

related questions