Using profile2, I created a profile, and it works fine. I want to list content authored by that user on that profile page. So, I created an EVA view, and I can't seem to figure out the right contextual ID configuration. I tried a few several combinations to no avail. What may I be missing?

The overall purpose is to display a profile page for users, along with a listing of their content they authored, using Display Suite (yes, the EVA field is visible). I figured this would be the most simple way to build a profile page.

Synchronicity! I just answered this question which I think is essentially the same question. I don't have any experience with Profile2, but I think this advice is applicable. Hope this helps:

How to create an entity reference view that contextually filters based upon current user ID

  • Thanks! I tried that already, because it makes the most sense, but doesn't work. I created the Content: Author relationship, and the User: Uid contextual filter. I feel like that should be it, but I am missing something small. – vintorg Jul 13 '13 at 23:29
  • Hmmm -is there a contextual filter option for something like "Profile2: uid"? I imagine you would have already tried that if there were. – Anne Bonham Jul 13 '13 at 23:39
  • There isn't. For the EVA, Profile is an available Entity Type, and the profile name is available for Bundles, so it seems Profile2 plays nice with views. Profile2 is an entity, so this should work fine. – vintorg Jul 13 '13 at 23:45
  • This looks promising (but may require additional modules): drupal.org/node/1874004 – Anne Bonham Jul 13 '13 at 23:48
  • It looks like that should work, but doesn't for me. – vintorg Jul 14 '13 at 1:17
up vote 1 down vote accepted

The answer was pretty simple, using Tokens. Set up your Content: Author relationship, and your User: UID contextual filter (using the author relationship). In your EVA, set your entity type to Profile, and bundle, accordingly. For Arguments, select "Use tokens from the entity view...". In the token replacement, use the token [profile2:user:uid].

Done! I know have my content authored by the user that belongs to the profile.

  • That's great and thanks for sharing. Sorry I steered you down the wrong road. I haven't yet played with tokens or non-node entity types. Good to know. – Anne Bonham Jul 15 '13 at 20:01
  • No, you got me on the right track. I tried to comment back, but it said we'd have to open up a chat and got too complex at that point. Thanks for your help! – vintorg Jul 15 '13 at 20:43

You do not need a Content: Author relationship.

Use the following settings for the EVA Field display :

ENTITY CONTENT SETTINGS - Entity type : User - Bundles : User - Arguments : id

CONTEXTUAL FILTERS - Content : Author uid - WHEN THE FILTER VALUE IS NOT AVAILABLE : Provide a default value - Type : User ID from URL

Hope this could help someone :-)

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.