How can I filter, if a comment is a new comment to a node or is an answer to another comment. As far as I can see, it is always the same form-id.

In other words: I added some voting fields to comments. Now I want users to be able to answer to a submitted comment, but the answer to the comment should not include the voting fields in the form.

I could hide it via css using "comment-form--2", but then the fields are hidden in another context, where they should be seen.

Thank you!

Comments

Jaypan’s picture

You should be able to implement hook_comment_view(), and to some checks in there. Set #access = FALSE for any fields you don't want to show.