I have a vocabulary (Countries) listing all countries. I added an entity reference field to the User entity (Nationality) referencing the Countries vocabulary. To the Article content type, I added:
- An entity reference field (article_countries) for the Countries vocabulary
- An entity reference field (article_owner) for the users
Every user created on the site has the Nationality field set to a taxonomy term value related to Countries
Every article created on the site has the article_countries field set to a taxonomy term value related to the Countries taxonomy vocabulary as well as the article_owner field set to a user
I have also created a view displaying the Article nodes as below:
The view is displaying all articles for which the article_countries is equal to the nationality of the currently logged-in user.
I want to add an exposed filter to filter the list of articles basing on the article_owner value. The filter must only contain all article_owners values referring to users for which the nationality is equal to the nationality of the currently logged-in user.
Finally the view will be similar to below screenshot.