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

basicmagic.net’s picture

subscribe

Drupal samurai for hire, based in Buffalo, New York, USA.
15+ years Drupal, 20+ years web.
http://basicmagic.net

coreyp_1’s picture

use the "page" variable in the url:

  echo $id + ($_GET['page'] * 50);

"50" is the number of comments per page. change it to whatever number is appropriate

- Corey

johnhanley’s picture

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.

NoRandom’s picture

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.

johnhanley’s picture

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.