1

I want to create a view block to display information about the author of a comment.

So I created a comment block and added the fields I missed. My problem, what contextual filter does it need to be added to show only the author of the comment and not all the authors ?

enter image description here

In response to 4K4 :

enter image description here enter image description here enter image description here

  • I don't want to click on a link I don't know, but this seems to be a node and your contextual filter is for comments. Or is the view for /comment/[id] in case someone clicks on a single comment? – 4k4 Aug 20 '17 at 8:54
  • @4k4 Each user has a personal profile (profile module). I want to display next to each comment a block view with the user profile (username, publication date, photo, sex and age). How do you do that ? – ZenImagine Aug 20 '17 at 23:21
2

To place a view block next to each comment use the module:

EVA: Entity Views Attachment

Create a new View for user, add an EVA display, connect it in ENTITY CONTENT SETTINGS to the Entity Type comment, the Bundle default comment and as Arguments provide the token for the user id [comment:author:uid]. Add a contextual filter for the User ID.

Now the EVA views block appears in the Comment Type and you can place it in Manage Display.

You can also use as Argument the comment id and connect it to the View you have in the question which is based on comments and has the author as relationship.

  • Thank you but how to configure the contextual filter ? – ZenImagine Aug 22 '17 at 1:24
  • You mean the contextual filter for the User ID? You need to configure nothing, though you can configure Display contents of "No results found", so that in case of an error, when EVA doesn't provide the correct argument, you see what is going on. – 4k4 Aug 22 '17 at 6:28
  • I have updated the question. I have 3 comments, the first one of "Samantha" and the other 2 of "Mathieu". On all the comments there is samantha. – ZenImagine Aug 22 '17 at 9:17
  • This could be a caching issue, switch in the view Caching to None and try again. – 4k4 Aug 22 '17 at 10:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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