As an example, imagine a game where each person can have 0+ marbles, each of which are entities. How could I create a list with each person, along with any blue (not any other colors, possibly creating multiple rows per person if they have more than one) marbles they have, still displaying them even if they don't have any. I'm thinking I would use an optional relationship, but if I put a filter, it completely hides the row if it has a match that doesn't meet the filter instead of treating it as if the relationship had no match at all.

Note: In the actual site, the "People" are ECK entities, and the "Marbles" are nodes with entity references to the "People".

EDIT: This is not a dup of Views and joining content types on specific field in Drupal 7 as that discusses how to create an required relationship in Views, whereas this one is about filters on optional relationships.

  • This question is about filtering on fields on the optional relationship without hiding the whole row, similar to adding a filter directly to the ON clause in the JOIN.
    – Gaelan
    Commented Jul 9, 2013 at 2:49
  • Can you edit this a little to describe why drupal.stackexchange.com/questions/12894 is not a dup.
    – mpdonadio
    Commented Jul 9, 2013 at 22:40
  • @MPD I have edited it.
    – Gaelan
    Commented Jul 10, 2013 at 1:24
  • Quite an old question... I'm looking for the same solution. I try to list persons having an optional relation to an event. I'd like to have an optional contextual filter on the event id, saying the person HAS or HAS NO relation to the event. Like a Left Join. My relations are not required. I'm looking for something like a normal filter saying that the event id IS NULL OR EQUALS the contextual filter. Hmmmm...
    – schulle877
    Commented May 26, 2014 at 13:14


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.