Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I want to create a view of "users" /profiles/<RealName> which lists selected fields from user content type. I accomplished this. But now, I want the same view to display selected fieds from the nodes created by this user.

I tried to do it by myself, but I'm unable to add relation to desired content type.

PS: I'm a newbie so kindly throw some details in your answer.

share|improve this question
    
What kind of fields do you want to display from the nodes they created? You can't really mix these two unless you use Views Embed View if you're trying to get specific fields from specific content types. –  KyleTaylored Feb 4 at 7:26
    
well, its pretty simple. These users are book authors. (contentype=book). I want display all the books they published. (coverpage, title) that it –  claws Feb 4 at 8:24
add comment

1 Answer

up vote 3 down vote accepted

1.Create a view for content of type all
2.Inside the view display node title and all other fields as per your requirement.
3.Add a contextual filter content : author uid
4.While adding that you will have a option for provide a default value
5. select that option and inside that use filter by 'currently logged in user'.
6. Save it by this you will be able to see all the nodes of current logged in user.
7. Inside the path you can enter just any path like '/my-nodes'. and you are done.
8.If you want you can avoid providing default value and switch to manual input by placing the path as '/my-nodes/%' and then just add contextual filter as 'content : author:uid' without default value(depends as per the requirement).
9.For user name you can add a relationship content author:uid then
in the contextual filter use User name with relationship author:uid

share|improve this answer
    
thanks harshal. If you are kindly available for 10min, I'll give it a try and post back result. I'm struggling to do this for a while now. –  claws Feb 4 at 5:17
1  
if I am reading the question correctly, you most probably want to get the default value from the path or url, eg, if this block is displayed on the user's profile page, you would want to contextually filter on that user id, not that of the logged in user. –  Jimajamma Feb 4 at 5:21
    
@Jimajamma updated the answer –  harshal Feb 4 at 5:30
    
@Jimajamma: yeah. you are right that I don't want that of logged in user. this is I want: even anonymous user can visit /profiles/Jimajamma and sees a big pic of Jimajamma, his name, age, hobbies, links to social network sites then a <selected fields> from all nodes by him. thats it. –  claws Feb 4 at 5:31
    
@harshal: this is I want: even anonymous user can visit /profiles/harshal and sees a big pic of Harshal, his RealName, age, hobbies, links to social network sites then a <selected fields> from all nodes by him. thats it. –  claws Feb 4 at 5:36
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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