I'm trying to create a view that filters the resulting pages (content type) based on the association of the same entity of the current logged in user.
This is my situation in detail:
- user: field_organizations (n) (Entity reference field to Content type : Organization)
- page: field_organization (1) (Entity reference field to Content type : Organization)
for example:
Users
Alice: field_organizations = [o1, o2, o3]
Bob - field_organizations = [o2, o3]
Charlie - field_organizations = [o1]
Pages
- page1: organization = o1
- page2: organization = o1
- page3: organization = o2
- page4: organization = o3
The view should return the following results:
- Alice = [page1, page2, page3, page4]
- Bob = [page3, page4]
- Charlie = [page1, page2]
I already tried to create a view (of users) that based on the current user ID (contextual filter) returns only the organizations associated to that user, but the problem is that I cannot use this view in the field_organization of the content type page to filter the results. It requires a view of content not a view of users.
Creating a view of organization I'm not able to reach the current user ID through the contextual filter.
Someone can suggest me an alternative solution? thx