1

Is there a way in Drupal 7 to display only the titles of node comments beneath the node (hopefully threaded), thus allowing users would click on title to see the full comment? This was essentially the behaviour in Drupal 6. In Drupal 7, I only see how to list the full comment title and body, or no comments at all.

Thanks for any suggestions.

1 Answer 1

1

Drupal 7 does not have this feature.

All you have to do is create your own javascript/jquery (.js) file and do something along these lines.

(function ($) {
     $(".commentbody").hide();
          $(".commenttitle").click(function() {
          $(this).parent().find(".commentbody").slideToggle();
          });

})(jQuery);

Here is an example JS FIDDLE

2
  • 1
    Thank you. I did find another solution, which is to create a block view that lists all comment titles for a node, and then place that block in the content area beneath the node. Not exactly what I had in mind, but better than trying to scan through the text of dozens of long comments. drupal.stackexchange.com/questions/80525/… Aug 14, 2015 at 3:51
  • Another way is to edit comment template and hide items from there (style="...") and you will be able to use js code from above in same way, just exclude hiding Aug 20, 2015 at 15:21

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.