2

Im trying to figure out what contextual filters to use but im getting no where, im trying to display content related to that user through an attachment on a page listing all users. So for example if I had user 1 it would display content from user 1 and if the user is user 2 and the attachment would display the content under user 2 and so on.

In the image below, I have the filters and relationships I am using on my attachment. on the page itself I have no contextual filters or relationships on it. I think that is fine since I am displaying just the users themselves, however I could be wrong.enter image description here

as you can see I have no contextual filters added on to the attachment because I am not sure which one is the correct one, I have tried different combinations with User: Uid and Content: Author Uid but have had no luck.

Any help is appreciated.

2
  • Is the end goal a listing of all nodes the current author is also an author of? Commented May 15, 2012 at 0:09
  • yes, I was able to partially do this but with aggregation but the fields using the nodes were only showing 1 node instead of all the nodes Commented May 15, 2012 at 0:52

2 Answers 2

1

You're over-complicating this with the extra relationships.

Drop everything under relationships and make sure your drop your relationship references on your fields as well.

Then just add a contextual filter for Content:Author uid and you should be all set as long as that uid is correctly getting passed to the attachment. You will want to end up with something that looks more like the attached screenshot.

Views contextual filter example

5
  • it has to have a relationship to get the node fields, if not then it is only listing user fields and no node fields. Commented May 15, 2012 at 18:44
  • Why start with a user view if the content is what you want? Commented May 16, 2012 at 18:18
  • because as mentioned above, i would like to display the user info, I have additional user fields that are in the layout, please take a look at the image attached to see what im trying to achieve i.imgur.com/wWCdP.jpg Commented May 16, 2012 at 18:57
  • Starting with a user view or a node one there shouldn't be any need to have both relationships. I would start with a node view because those are a lot more flexible then attach the two user fields as your attachment, then you'll only need a single 'Content:Author' relationship. Commented May 16, 2012 at 23:07
  • I found it, i will be posting the answer shortly Commented May 17, 2012 at 0:16
1

I was able to achieve what I wanted in views by creating a user type view adding the relationship User: Content authored and going under Format and settings and grouping the fields that I wanted to display, I then went back to those fields under "Fields" and excluded them from displaying so it does not show duplicate fields on the page. No attachment was needed.

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.