I have 2 node types: Photogallery and Photoimage. Photoimages have a relationship with Photogalleries via a node reference field. I currently have a View that shows me all Photogalleries with a count of the number of Photoimages in it and the last Photoimage update date (via the Views Group By module). However, this view does not show Photogalleries that have no Photoimages in them. After some pulling my hair out trying to make a module that replaced the view query I would rather not go that route (for now), I just need to get something quick and dirty up and running. I'll use 2 blocks, 1 showing the Photogalleries with images, and 1 showing those without.

The question is how can I set up a view that filters a list of Photogalleries that do not have associated Photoimages?

The problem seems to be that the Photogalleries have no reference to the Photoimages so when I try to use the relationship columns they always come up empty and I can't filter on them.

Currently looking into the Node Relationships module and I'm hoping that this doesn't add complexity to the end users.

EDIT - actually Node Relationships doesn't do what I need at all. Still looking for a way to do a Select with a left join group by Photogalleries with a count on Photoimages.

Comments

mattiasj’s picture

I am currently working on a similar solution, but I haven't even yet succeeded to count the child nodes of my galleries using the Vies Group By module. Would you like to share how you grouped and aggregated your fields?

As a answer to your question, if you dont require the relationship between photo and photogallery, shouldnt then empty galleries also be displayed? That works within my views.

tpainton’s picture

This might help. I had a hard time with this one.. I finally solved it using Node Referrer Module. Essentially, you are trying to list nodes that are not being referenced ie Galleries that are empty.

http://drupal.org/node/617610