Limit the Depth of comment to certain number
In Drupal 7 you might have observed that when you enable the comments on any node at that time it also allows you to add the comments.
In each comment there is link to add the replay, but drupal doesn't provide any management to limit the depth/number of replay using interface or any module.
But we can customize using hook_preprocess_HOOK().
For comment display we have to create hook like themename_preprocess_comment() function in template.php file of theme.
After that we have to find the depth of the comment tree. You can find it using $variables['elements']['#comment']->depth variable.
This will print the depth of variable. Now compare width with required width and unset the replay link using unset($variables['content']['links']['comment']['#links']['comment-reply']);
This will work globally, but you can put condition and manage it for perticular content type only.
Here is full code for bartik theme:
Comments
Peperoni Ripieni (not verified)
Sat, 05/25/2013 - 17:40
Permalink
Limit the Depth of comment to certain number | Mohit Aghera
Aw, this was a very good post. Taking the time and actual effort to make a superb article…
coupons-cunt (not verified)
Wed, 07/10/2013 - 04:32
Permalink
Add new comment | Mohit Aghera
I wanted to thank you for this very good read!
! I certainly loved every little bit of it. I have you book marked to look at new stuff you
post…
natural thyroid (not verified)
Wed, 08/21/2013 - 11:37
Permalink
Add new comment | Mohit Aghera
Why aren't Pro-Choice people rallying as well, although without quite the same veracity. Separar as linhas de fora, verdades de fora, verdades de subjetivao. I felt I finally had weighr loss enough cause to write about the thinspo issue. La Corte Suprema de Connecticut 1996: La Sra. Comecemos pelo equilbrio Hoje vou falar-vos um pouco mais restrita, em 2, 7 mil cinemas.
tablette graphi... (not verified)
Mon, 07/15/2013 - 12:58
Permalink
Add new comment | Mohit Aghera
I'm amazed, I have to admit. Seldom do I encounter a blog that's equally educative and interesting, and without
a doubt, you have hit the nail on the head. The problem is something that
too few folks are speaking intelligently about. I am very happy I came across this
in my search for something concerning this.
sacoche homme (not verified)
Fri, 07/26/2013 - 03:40
Permalink
Add new comment | Mohit Aghera
You've made some really good points there. I looked on the net for more information about the issue and found most people will go along with your views on this site.
flor (not verified)
Tue, 02/25/2014 - 02:14
Permalink
This is my first visit to
This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us beneficial information to work on. You have done a marvellous job! Friends seasons 1-10 DVD Box set | Rules of Engagement Seasons 1-5 DVD Box set | The Walking Dead seasons 1-3 DVD Box set | Supernatural Seasons 1-8 DVD Box set | Futurama Seasons 1-5 DVD Box set
Mily (not verified)
Mon, 04/07/2014 - 11:57
Permalink
well, this is really a nice
well, this is really a nice post.I really like the way you start and conclude your thoughts. Thank you so much for this information. - Jual Tas Online - Jual sepatu formal wanita
nobelboy (not verified)
Thu, 04/10/2014 - 15:11
Permalink
A very awesome blog post. We
A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work
Binary options trading
personal statem... (not verified)
Tue, 04/29/2014 - 13:29
Permalink
Throughout Drupal 7 you might
Throughout Drupal 7 you might have observed any time people enable the actual reviews with any kind of node then it also means that you can add the actual reviews.personal statement mba
abbyconner (not verified)
Fri, 05/16/2014 - 12:56
Permalink
A very awesome blog post. We
A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work!
<a href="http://socialformula.com/soundcloud/downloads">how to buy soundcloud downloads</a>
Clipping Path S... (not verified)
Wed, 06/18/2014 - 11:44
Permalink
Clipping Path Service
Thank you a lot for this wonder-full post! This post is really really good. It has excel information that I really needed to complete my project. And I want to thank you for that!
Johnk998 (not verified)
Thu, 08/21/2014 - 06:51
Permalink
I really enjoy the blog post.
I really enjoy the blog post. Great. kdafedggfdaa
Add new comment