I am currently bashing my head against the wall trying to figure out how to do the following...

I have two content types, "Artist" and "Artwork." In the Artwork content type, it uses a node reference to specify which artist created said work.

I need to create a table (with sortable columns) in Views that lists each artist with a comma separated list of all their referring artwork, basically it needs to look like the following...

------------------------------------------------------------------------
Artist                  Artwork
------------------------------------------------------------------------
Jane Doe                Sculpture #1, Sculpture #3
John Doe                Sculpture #2, Sculpture #4, Sculpture #5
------------------------------------------------------------------------

I created a Table View Page using relationships to do the above, but it comes out looking like.....

------------------------------------------------------------------------
Artist                  Artwork
------------------------------------------------------------------------
Jane Doe                Sculpture #1
Jane Doe                Sculpture #3
John Doe                Sculpture #2
John Doe                Sculpture #4
John Doe                Sculpture #5
------------------------------------------------------------------------

No good, the Artist is being duplicated for each artwork and should only be shown once. "Ah, use the grouping field in the Table options" I thought. But then when I group by the Artist field, I get this mess (who seriously thought this output would be a good idea?)....

                              Artist: Jane Doe
------------------------------------------------------------------------
Artist                  Artwork
------------------------------------------------------------------------
Jane Doe                Sculpture #1
Jane Doe                Sculpture #3
------------------------------------------------------------------------


                           Artist: John Doe
------------------------------------------------------------------------
Artist                  Artwork
------------------------------------------------------------------------
John Doe                Sculpture #2
John Doe                Sculpture #4
John Doe                Sculpture #5
------------------------------------------------------------------------

I tried using a separator (,) in the Artwork field hoping it would group the multiple rows together, but it doesn't do anything. Is there not a way to make the Table view look like the very first example I given?

Comments

kenorb’s picture

Similar issue, I need to group two column into one.

Instead of 4 columns:
-----------------------
John | View node | Edit node | Delete node
-----------------------

I need 2 columns:
-----------------------
John | View node
Edit node
Delete node
-----------------------

drupalina’s picture

try module called "nodereferrer" -- works with views, so you can produce a list of nodes (artists) and a list of Nodes (artworks) that refer back to it.

iNade’s picture

Subscribe.

Anonymous’s picture

I fail to see how "nodereferrer" should help here ...

vireodesign’s picture

subscribe

Letharion’s picture

Assigned: Unassigned » esmerel

I'm guessing this will require it's own output handler.
@Esmerel, could you provide a second opinion?

kamiel79’s picture

Hi,

i am new to drupal but have some computer experience :)
i installted tons of modules and have this TINY problem: how to create a list of "profiles" where the data comes from different tables. I googled it for two nights now, and I can't solve it. Can you believe it, I hold a master's degree in computer science! I found nothing in the documentation, no tutorial, nothing. I could of course write a new module for it but hey, that's a lot of work...

So, how to output this
------------------------------------------------------------------------
Artist Artwork
------------------------------------------------------------------------
Jane Doe Sculpture #1, Sculpture #3[price,date]
John Doe Sculpture #2, Sculpture #4, Sculpture #5
Billy Bob Sculpture #6 [price,date, photo,...]
------------------------------------------------------------------------
i tried relationships, arguments, no good. I want to generate LONG lists of "profiles" with a lot of nodes referring to it. I can't believe this is happening :!!))

happy december,

k

esmerel’s picture

@#7 - are you trying to do the same thing the original poster is doing? I'm not entirely sure. If you aren't, please open a new issue. If you're not doing the same thing, it's considered issue hijacking and is frowned upon :(

monotaga’s picture

Anyone come up with any further thoughts on this?

jromine’s picture

To get sortable columns, you'll have to get the concatenation of the artwork values into a single field, so the view can sort by that field. I don't know any way to do that.

If you don't care about click-able column sorting, you can write your own views style template to get the presentation you want.

kbk’s picture

Hmm...I'm working on this as well. These modules are worth a shot - although my brief testing does not give me much optimism:
http://drupal.org/project/tablegroup - The most promising but not really there
http://drupal.org/project/views_groupby

zeezhao’s picture

You can also try using the http://drupal.org/project/views_hacks which contains a module views_flipped_table for flipping rows into columns

Alternatively, do via php using: http://drupal.org/project/views_customfield to create a new field

esmerel’s picture

Status: Active » Fixed

There's some good suggestions here; if these don't work, we can re-open.

Status: Fixed » Closed (fixed)

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

Yuri’s picture

I used the http://drupal.org/project/views_field_view module which gives the most flexibility with regard to combining / grouping and displaying fields. It allows to embed a view as a field in a view.

Yuri’s picture

And this is the easiest solution: Add a Global field - custom text and include the fields that you want to group together. Hide display for the fields that you included. You can use html to insert line breaks, greate lists etc. in that global field.

roflcopterDorrie’s picture

I was able to solve this using Views Aggregator Plus .

Go to your view, select Table with aggregation options as your Format.

Apply group function to Artist, set Group and Compress.
Apply group function to Artwork, set Enumerate and set the parameter to ', '

Works a treat!

ajimenezz’s picture

#17 contribution works perfectly! i was crazy searching for a solution to this, and with Views Aggregator Plus i could do it.

Thanks!