Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How can I override the javascript or whatever who toggle the comment to be open by default in the stream. I would like to have all the comments close by default and let the users click on more comment by themself.
Thanks
Comment | File | Size | Author |
---|---|---|---|
#7 | add_hide_comment_option_1.patch | 2.37 KB | 7wonders |
#4 | add_hide_comment_option.patch | 2.48 KB | 7wonders |
Comments
Comment #1
muschpusch CreditAttribution: muschpusch commentedI did that in a bad way but it works:
Comment #2
sw3b CreditAttribution: sw3b commentedOK thanks i will take a look this week...
Comment #3
7wonders CreditAttribution: 7wonders commentedWhere would I put the code above to get the comments closed by default?
Comment #4
7wonders CreditAttribution: 7wonders commentedThe attached patch adds an option to the comments plugin page to hide or show comments by default (they can still be opened by clicking the number of comments). I stayed away from the js and made the changes in activitycomments.inc. Please review.
Comment #5
Stalski CreditAttribution: Stalski commentedThere are two problems with this patch:
- you skip the feature where commented activity starts open and others closed
- the patch has redundant code in the else. the result is "none" in the ternary operator
Comment #6
7wonders CreditAttribution: 7wonders commented@Stalski - my apologies, its my first patch ever (yes, sad but true). Can you explain what you mean with the first of the problems and give me some pointers on fixing it as the patch works exactly as intended for me = all comments are closed until the comment count is clicked. I see what you mean with the second problem, that was a bit of a brain fart.
Comment #7
7wonders CreditAttribution: 7wonders commentedHere is the updated version removing the brain fart but you will have to explain the first problem for me.
Comment #8
Stalski CreditAttribution: Stalski commentedProblems are gone. Fixed and pushed to git.
Comment #9
sw3b CreditAttribution: sw3b commentedGreat work ! Thanks !