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.
I would like user comments on paged threads on my site to be numbered in the following way:
#1, #2, #3, ....., #last comment
I managed to sequentially number comments in every page of one one thread on multiples pages. So every comment on a page has its number, which is one more than number of the previous comment. But unfortunately my code does not continue the sequence on the second page, but starts count from 1 again. Can you please explain how to make comments of one thread to be numbered sequentially. I hope I managed to explain what I want.
Comments
Comment #1
reswild CreditAttribution: reswild commentedCan you post the code you have written so far?
Comment #2
nevets CreditAttribution: nevets commentedIf you look at the URL for the second page of comments it will have something like page=10 so that tells you what page you are on. That along with the number of comments per page should allow you to get the correc starting point, something like
If page is not the right name for the query parameter, change
$_GET['page']
to reflect the correct name.Comment #3
yngens CreditAttribution: yngens commentednevets, thanx! works perfectly. the only thing i needed to change in your code was '1' to '$id' in last line. so final code looks like:
Comment #4
jmai CreditAttribution: jmai commentedI wonder where I would insert this code into the comment.module to add this feature?
Comment #5
ricabrantes CreditAttribution: ricabrantes commentedNo activity, Closed..