How can you create a view of content in a specific node type where there is an email address that will correspond with the email address of currently logged in user's email address? The content is not owned by user. This view will be used to assign relations to the user and other content with rules.
-
Contextual filters on User ID from URL. If it must be the email you may have to do some grabbing but the uid will get you there.– sareedCommented Oct 6, 2015 at 21:28
-
There is also "User ID from logged in User," But how do you grab the email from the User ID within contextual filters? This is dealing with attaching pre-registered info gathered from another site.– KentonrCommented Oct 6, 2015 at 21:45
-
This worked for me: drupal.stackexchange.com/questions/200641/…– kjvysaCommented Nov 3, 2016 at 14:39
2 Answers
Here is the approach to provide a relationship between content and logged in user:
- Create a user view.
- Add a contextual filter on User: E-mail.
- Add a relationship on User: Content authored.
Now you can do rest of you functionality.
Since the content is not authored by the user, I needed to create a relation from the user to the content. The content has a matching email. I was able to achieve a list of content filtered by a user's email through Rules, VBO, and passing the email address as contextual argument. Then rules can apply the relation to the content.