Say I have a content type of Fruit, and I have nodes of this content type with titles "Apple", "Pear", "Banana". Then on a user profile I have a field of type Entity Reference (unlimited values) to nodes of type Fruit, so an individual user might have an entity references to "Apple" and "Banana" in this field.

I want to create a View which is a table, with each row being a fruit, and then an indication in the row (a tick or yes or whatever) if the current user has an Entity Reference to that fruit on their user profile.

I have created a Relationship (Entity Reference: Referencing entity) in the view to the Entity Reference on the User record. However, if I then add a "User referencing Content from field_fruit" field to my table, it returns a list, i.e. "Apple, Banana" on the Apple row and the same on the Banana row. This wouldn't be a problem except if there is no result it doesn't return an empty result, rather an empty list of nothings, i.e. ", , ," - which doesn't count as an empty result.

Is there any way I can fix this?

  • create of users then add entity relation on it after that adds fields in view – Adeel Nawaz Nov 6 '15 at 10:59
  • Adi, sorry I'm not sure what you mean. Isn't that what I said I did in my third paragraph above? – James Nov 6 '15 at 11:05
  • have you ticked require this relationship? coz it seems you ticked. uncheck the checkbox – Shabir A. Nov 6 '15 at 11:19
  • it is inverse of your current view when you create using user empty space will solved – Adeel Nawaz Nov 6 '15 at 11:21
  • Shabir - no I don't have that ticked. – James Nov 6 '15 at 11:42

Your Answer

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

Browse other questions tagged or ask your own question.