List -> l_user
I have a List
node that has a user-reference field (l_user
).Story -> s-user
I then have
I'd suggest getting all of the user references from the list node and passing those into a views argument. So your code would look something like this (untested):
$user_ids = array();
foreach ($list_node->l_user as $user_reference) {
$user_ids[] = $user_reference['uid'];
}
$view = views_get_view('list_view');
return $view->preview('block_1', array(implode(',', $user_ids));
That assumes you have a view named 'list_view' with a display named 'block_1' (you can see the machine name when you hover over the display). That display needs to be a node view with a filter of node type 'story' and an argument of content user_l set to take multiple values. There's almost certainly a bug in that code, but I know the general concept works, as I've done it several times before.