On my D7 site I am trying to enable users to view the nodes where they have submitted their comments. I have tried adding 'Comments of the node' relationship, then added 'Comment: Author' and 'Comment: Author uid' contextual filters. Then set up filter criteria 'Comment: Author' to be equal/not equal to [current-user:name] and [current-user:uid]. It didn't help.


The following works for me without a problem. I'm not sure where my method differs from yours:

  • Relationship: Comments of the node
  • Contextual filter:
    • Author uid using comments relationship
    • Provide default value: "User ID from logged in user"
  • Use aggregation: Yes (to avoid duplicate nodes)

That's all, and it works like a charm.

|improve this answer|||||
  • Yes, it really works with default value in contextual filter. But what I needed was to create an exposed filter where current user would choose whether he wants to see all nodes, or only those he commented (or did not). I tried adding filter criteria 'Comment: Author uid' and setting up grouped filter using [current-user:uid] token. This didn't work. – Timur Kutuev Feb 5 at 21:16
  • Aah. Well that is a totally different question than the one had asked. I would probably just create 2 views for that, one with the filter, and one without. Rig it up with some javascript. – Menno van den Heuvel Feb 6 at 7:46

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.