Creating a view that shows all events and the users that have signed up for each event I am using the Signup module, and I am looking to create a view that shows all events and the avatars (default Drupal user picture field) of the users that have signed up for each event.

Here is a mockup of what I am trying to achieve. I have everything but the avatars so far.

View Mockup

See export of the View I have so far
Doing something like this is pushing views to it's limits. You want to pull in a lot of data and group it by the node id. I'm not sure if all this is possible through the views interface, though I believe it will be possible with the engine that's running views.

Instead of trying to achieve this rather complex view, which may become something, that's hard to modify, you could do this quite easily using more and simpler queries. Such a simple solution could look like this:


You could create a simple view, which display all the info except the signups. (Node title etc)
Signup already has a view, which will display the people that signed up for an event. With a little bit of modification, you could make it show the avatar of the users that has signed up for an event. Then you could embed this view in either a preprocess function and/or a template for the view you created in step 1.
You're done.


The ideal thing would be to create all of this in a single view, but sometimes you have to think about what the cost will be compare to the gains. I doubt you will be able measure any performance differences, unless you list hundreds if nodes with signups. But the time you save doing it this way is quite a lot.

This is the same with views itself, it's inefficient, but nothing important (for most sites) and it allows us to save lots of time, not having to code queries, theme functions etc.

Update:

Embedding a view with arguments (like node id) is pretty simple:

$html = views_embed_view($name, $display_id, $arguments)


Or in your case

$html = views_embed_view('signup_user_list', 'default', array('nid' =&gt; $nid));