8 - How do I check if a comment is from original poster? I have a page where written articles are displayed. The following is a article written by Canada_Girl1993.


  


As you can see, the author of the article is displayed at the top.

Now, other users are able to comment on this article, as well as the author of the article. But how can I check if a comment is from the author of the article, so that I can add some styling or html to it?
Actually, before you write any code... D8 automatically adds a 'by-[entity-type]-author'(e.g. by-node-author) class to the &lt;article&gt; tag of each comment, if commenter and author are the same.
This is defined at line 73, in comment.html.twig file(at least this is the case in Bartik theme file), so please take advantage of it :)