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.
By NoRandom on
I'd like to add a secuential number in my comments since it helps a lot the answers, citations, etc...
In my custom comment theme I used:
echo $id;
and it works partially. The problem appears when you navigate to the second, third... page of comments; the first comment of each page will be again the #1 and so on.
You can see an example here: http://www.pixelgordo.com/forum/nuevo-tema-para-el-foro?page=1
Is there any workaround to this?
Thanks in advance.
Comments
subscribe
subscribe
Drupal samurai for hire, based in Buffalo, New York, USA.
15+ years Drupal, 20+ years web.
http://basicmagic.net
use the "page" variable in
use the "page" variable in the url:
"50" is the number of comments per page. change it to whatever number is appropriate
- Corey
comment number
I'm not sure if this is what you're referring to, but you should be able to use the variable values of page number and items per page to number each comment. For example, if you are outputting 25 items per page, the first page of comments would be numbered from 1-25, the second from 26-50 and so on. You'll need to create a custom comment theme to include the comment number.
That works perfectly, thanks
That works perfectly, thank you, coreyp_1.
Bacteria Man, I just know very few things about php, wich variables are you mentioning exactly? I looked up the comment variables and I didn't found anything.
comment.tpl.php
I not completely sure, but it's possible a comment counter property is contained in the comment object. You'll have to do some digging. Try outputting the comment object in the comment.tpl.php template.