I have created Galleries by following the tutorial here:


I managed to do it fine and have the galleries working.

Now what I would like to do, is to be able to attach that view to the Profile2 for each user.

I tried different ways, but I probably don't have the concept right and time is pressing. I would really appreciate if anyone could give me a pointer.

Just by changing the EVA parameters from Content: Album to Profile: Name of Profile. I assumed the view was going to get attached to Profile. Well it does!

But How do I filter the content in order to just get the attached images uploaded by the profile owner?

Also, I have the following issue, the profile author is always the administrator, since users cannot create profiles. They are able to edit them after the profile is created by the admin.

I thank anyone who can give me a tip on how to solve this issue.

Further info: Using Drupal7, Profile2, Views3, Eva

FOUND OUT YET ANOTHER ISSUE : The "Add more images" link as per the reference node is public. If you set this field as private, it only affects the display of the Title(link) in the image node, but the "Add more images" link shows and can be used by anyone. How can this be solved?


1 Answer 1


I am going to answer the first part of my own question:

If you need a gallery per user and you need to attach it to a profile2 type. Follow the tutorial linked to in above question, to create each gallery.

  • Clone the gallery view (EVA Field), and change in Entity Content Settings.
  • For Entity Type use Profile.
  • For Bundles, the profile types you want the view to be attached to.
  • For Arguments, choose token, and select profile2:user:uid.
  • Go to Advanced and add a Content: Author relationship and Contextual Filters: (author) User: Uid. In the settings of the Contextual filter choose author for Relationship (that's what appear between brackets) and also for WHEN THE FILTER IS NOT AVAILABLE select Provide Default Value -> User ID from URL. And below, Specify Validation Criteria > Choose "User" as the Validator from the pull down, and "Allow both numeric UID's and string username (I don't know if that's strictly necessary but broadens the possibilities).
  • You may want to (I did) restrict the selected roles to those that have that kind of profile2 type. Done.

Now I need to figure out how to restrict the "Add more images" link. If anyone can answer that, I appreciate.

  • I have created a URL alias pattern for the images content type that includes the USER ID in the URL when an image is uploaded.
  • The only way I found to restrict access to the "Add more images" link for anyone but the gallery author, was to completely disallow the gallery node view by anyone but the author (Since the images appear in the profile, it makes sense) but I would've wanted to make the galleries visible anyway, only make the link private. So if anyone does know hot to accomplish this, with a PHP snippet or otherwise programmatically, I would appreciate a response. Thank you.
    – cara
    Commented Jan 4, 2013 at 10:34

Your Answer

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

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