1

Say I have a Content type of Fruit. I have an Entity Reference on the User Profile to Fruit nodes. I want to create a view that shows all Fruit nodes that are NOT referenced by the Entity Reference on the current user profile.

(More details: I can create a view that includes Fruit nodes on the current user profile, by creating a view of Fruit nodes with a Relationship to the Entity Reference on the User Profile. Alternatively, by creating a View of users, filtering by current users, and then using the entity reference to show the data from the Fruit nodes. However, I haven't found a way to create a view of Fruit nodes that are NOT referenced on the current User Profile.

0

Views Reference Filter might help you:

This module provides the feature missing in Views module - subquery filter for IN (NOT IN) condition, such as (quite informal):

SELECT n.title FROM node n WHERE n.nid [IN | NOT IN] (SELECT n2.nid FROM node n2 WHERE ...)

or

SELECT n.title FROM node n WHERE n.node_reference_field [IN | NOT IN] (SELECT n2.nid FROM node n2 WHERE ...)

  • Thanks, I've not come across that before. I'll look into it. – James Nov 8 '15 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.