Comments
Threaded comments template.
Projects /
Threaded comments template.
The Comments component is used to display a threaded comments section. It's often positioned at the end of blog posts (or similar content types).
When a user likes a comment (clicking the .js-comments__vote-btn
element), a custom newVote
event is emitted:
var commentBtnVote = document.getElementsByClassName('js-comments__vote-btn')[0]; // first comment vote Btn
commentBtnVote.addEventListener('newVote', function(event) {
// user liked te comment
// event.detail.count -> new value of cmment likes
// event.detail.upVote -> true if the user liked the comment
});