We have a comment body, using views, where we have the name, comment, picture, and date for each of the posted comments. At the end of all comments we have a comment body, where one can add a comment.

Now this works great for a linear comment system, but we want a threaded system in place. In views, I can add a reply comment link, but that takes me to a new page.

What I want is JavaScript based action, such that the comment form, goes below the reply link when reply button is clicked. Is this possible via views?

If not, what's my best option?


I enabled a module called ajax comments. This works great with default drupal comment system, but not so much with views. I added the required classes, and got the basic thing to work but the newly added comment doesn't appear until you refresh the page. Also the message (queued for moderation) comes at the bottom of the page.

If someone has set this module up successfully with views, please let me know.

6 Answers 6


Have you looked at Inline Ajax Comments?


you can render your form in th template file of your view.You can include this code in your views--view-YOUR_VIEW_NAME.tpl

$build = drupal_get_form("comment_node_{$node->type}_form", (object) array('nid' => $node->nid));

print render($build);

I just want to add something to your updated portion, may be it will help you.

If you are able to appear the message bellow you can bring it up by using the custom template of comment-wrapper.tpl.php and to display message without refreshing the whole page you can refresh the <div> on reply submit/save using drupal_add_js.

  • Thanks, Was this your first answer? :-) We are looking to do something exactly like that, but opening in a lightbox instead. No offence to Drupal, but wordpress handles 4 things so much better than Drupal, right out of the box mainly being wysiwyg, subscription, media, and comments. Though CKEditor and Media with it's latest patch, is so much better! Commented Nov 7, 2013 at 10:10

For this use Entity collection module, where make comments as entity and make collection of entities, by that you can perform threaded comment system.



Using AJAX comments with default settings is a good idea, but any modifications to it can really cause things to break. When I worked, it did not even provide any hook() for data modification.

It is better to do it in a custom way, which is much easier and flexible as per needs.

  • Ajax Comments is so buggy that we had to give up. I cannot believe Drupal doesn't have a lovely comment system by default - reply takes you to a separate page instead of an ajax/js functionality. I feel like I should be contributing this to D8 if I can. We usually use Disqus, but the clients insisted on no Disqus, so we had to go through this approach. Right now we are just framing, the reply to open in a lightbox. Commented Nov 7, 2013 at 10:06

just add Comment: Thread ‪(asc)‬ to your sort criteria. It keeps all comments of same thread together

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.