By Rosamunda on
I´ve seen in a lot of sites (and I want to emulate them :-) that the comments are numerated. In example:
#1
Comment by Andy on Sat. 14.02.2006
bláh bláh
#2
Comment by Samir on Sat. 14.03.2006
bláh bláh
#3
Comment by Andreas on Sat. 20.03.2006
bláh bláh
And so on and on...
How can I do that?
I know that maybe I solud add/modify something at the comment.tpl.php template... but what??
Thanks in advance!!!
Rosamunda
Comments
$id - 4.7
in comment.tpl.php
print $idthis is 4.7 ~ can't remember what it used to be
Exactly what I needed!!
Thanks!!!! Just what I needed!
It works perfectly.
Rosamunda
It does not work for the 2nd
It does not work for the 2nd page. It seems $id is initialized for each page. Therefore on 2nd page and thereafter $id does not reflect correct comment number.
Has anyone been able to get this working?
Same here... Wow, this is
Same here... Wow, this is pretty old, as with the bug of permalinks on pages other than the first; that one's 3 years old. What the hell man...
Would like a fix for this please. :)
ID by date
another prob is that the comment # is not ordered by date, but by how it's listed on the page. For instance, this would be the 5th comment posted, but since it's a reply to a higher comment, it shows up higher and would print $id would show as comment #4 ....
well not exactly on this thread because all the comments are replies, but on other pages the prob materializes
Keep it Alive...
Yeap! Keeping this alive to see if someone can help about the second page issue...
And how it would be with 5.x ...
Rosamunda
Buenos Aires | Argentina
www.ligadelconsorcista.org
Any ideas?
Any ideas on how to fix this?
Rosamunda
Buenos Aires | Argentina
www.ligadelconsorcista.org
No ideas in 3 years??
No ideas in 3 years??
I'm still curious how to do
I'm still curious how to do this either.
Similar stuff for Drupal 6.x
In http://drupal.org/node/538208
Solution for Drupal 5
Reusing some of the code from that Drupal 6 thread, I put the following in my comments.tpl.php file (for my Drupal 5 site):
At the top:
Then to call the number in your template:
I know it's not ideal to put that first php part into the template but i wasn't able to get template.php to utilize the $id variable.
Hi, I can't understand the
Hi,
I can't understand the script - I don't know any php.
It appears that this would be fine with flat comments and work across comment 'paging'.
But would it work with threaded comments?
Is numbering only really practical with flat comments?
Drupal 6-7 module
Just wanted to close this thread.
In Drupal 7 we can use https://drupal.org/project/comment_easy_reply to achieve this. I found this case, when I was searching for this function.
Thanks.
GrN.dk
Someone might find this
Someone might find this useful - modified comment.tpl.php in D6 and copied to theme:
<a href=<?php print '"#comment-' . $comment->cid . '"' ?>><?php print '#' . $id . ' ' ?></a><?php print $title ; ?>sorry - dupe posting
sorry - dupe posting deleted...
Thanks bro, works on D7 too
Thanks bro, works on D7 too
Solution for Drupal 7
thanks michaellenahan, worked
thanks michaellenahan, worked for me.