In Views how to configure a contextual filter to exclude the node being viewed? I have the following setup: a content type (event) can have a "mother" event, which is configured as entity reference (Basically it's the same event on another date).

I have a view for a single event which is embedded in a panel pane and another view for the other similar events (with the same "mother") in another panel pane on that page.

This works pretty good, except when i try to filter out the event that is shown on the first pane from the second pane, so that this one isn't shown twice.

The view for the "related events" has a contextual filter of the nid and relationship to the "motherevent" which is set to "required". 

Now you would say, check the exclude field for the contextual-filter. Yes, this works, but with a side effect: all other events not related to the "mother" are shown as well. 

I feel like I have arbitrary tried all possible combinations of "set relationship" / required and so on, but with no effort. I even tried a second contextual filter of the nid with different settings... I don't get it.

Can someone please explain how this could be achieved? Thanks a lot!
The problem I believe is the relationship. I assume the entity reference on each event points to the parent event, including that on the parent (recursive).

Get rid of the relationship. Set up two contextual filters, one on Content:Nid and the other on Content:field_parent.

On the configuration for the contextual filter on NID, set the default value to Content ID from URL, open up the 'More' settings, and select 'Exclude'.

For the contextual filter on field_parent, set the default value to PHP Code and use something like the following:

$node = menu_get_object();
return $node-&gt;field_parent['und'][0]['target_id'];


This will get the ID of the parent from the current node, and will require all nodes displayed to have the same parent. The exclusion of the current node from the list will work, and you will have a list of all other children related to the same parent.