Referring to specific comments

eliason's picture

Not too long ago Typophile added the useful ability to link to specific comments within threads. Clicking on the timestamp of any comment will produce the link.

I have noticed that this doesn't seem to work when the comment to be linked appears on a page beyond the first in a multi-page thread. The link doesn't insert the required "page=n&" into the address, so following the link just goes to the top of the first page of the thread.

Florian Hardwig's picture

You can (manually) add this bit to the URL, right after the node number, before the #:
?from=0&comments_per_page=5000
This is just a workaround, not a solution to the bug.

Michel Boyer's picture

Or you can add manually the appropriate page number, as in http://www.typophile.com/node/81129?page=1#comment-461794 ; notice that it is "page=1" and it is page 2 (it is always one less). The timestamp should indeed contain the page number (I added a blank before the semicolon for the link to work).

eliason's picture

Yes, I successfully added the page number manually as Michel suggests when I tried it, but seeing Florian's workaround I wonder if Michel's would break based on having a different setting for comments per page. Is that a user-adjustable setting, by the way?

Florian Hardwig's picture

Is that a user-adjustable setting?
No, at the moment not. But it has been adjusted globally in the past

Also, there is the (unlikely) possibility that you want to link to comment no. n+1 (n = maximum number of comments per page), and later on, an older comment gets deleted, making the one in question the n-th.

Michel Boyer's picture

I just counted (in fact, I wrote a script to count) the number of comments for each page of http://www.typophile.com/node/123 and I get 90 comments per page for page 1 to 7, and then less than 90 comments on page 8. What does the number 5000 then represent in comments_per_page=5000 ?

Florian Hardwig's picture

This number overrides the default maximum number of comments per page (yes, 90 – at the moment) . You can also enter a different value. But with a value as large as 5000, you practically request a thread with all its comments, as a single page.

Michel Boyer's picture

And I think the clean solution is a link like this:

http://www.typophile.com/node/123?page=5&from=0&comments_per_page=90#com...

that specifies the page number but also the current number of comments per page, namely 90. You are then linked to the right page (and not to a single page thread) and even if the number of comments per page ever changes, the link will still be valid.

Syndicate content Syndicate content