Skip to main content
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
Source Link

View only your own comments, no one else's?

I have a client who would like users to be able to comment on content without being able to see any other users' comments. This is for a review system where users shouldn't feel influenced by the views of other users. I'm using Drupal 9.3.14 and a subtheme of Radix.

I have tried adding this to my theme's comment.html.twig:

{% if author_id == user.id %}
    {{ content }}
{% endif %}

That works for a while, but after a while, users report that they can see some other users' comments, but not all of them.

How can I make sure that users can always see only their own comments and no one else's?