0

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.

3 Answers 3

1

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

6
  • 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, 2013 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. Jul 13, 2013 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, 2013 at 23:45
  • This looks promising (but may require additional modules): drupal.org/node/1874004 Jul 13, 2013 at 23:48
  • It looks like that should work, but doesn't for me.
    – vintorg
    Jul 14, 2013 at 1:17
1

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.

2
  • 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. Jul 15, 2013 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, 2013 at 20:43
0

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

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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