1

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

Currently:

  • 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:

View Display

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.

View Display with filter

  • As side note, since nodes already have a field for the node owner, what is the purpose of adding another field for the node owners? – kiamlaluno Oct 5 at 9:27
  • 1
    @kiamlaluno I thought someone will ask such logical question ! There is no any purpose and this is not the real case, article_owner field is a replacement of the real field but client asked to not expose any information publicly. – Ta La Oct 5 at 11:41

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.