I would like a user who has previously left a comment on a node to initially see the last page of comments while a new user (to that node) will initially see the first page of comments.
I know that the page is controlled by the pager and is set by the "page" variable in the URL ($_GET['page']). Is there a way to set this programmatically?

(Just to clarify, I am not using the Views module on this project.)


1 Answer 1


You can use AJAX to call a new request so you will not have the page in the URL or, if you use Views, select "Use AJAX" under the Advanced Settings, and it will enable AJAX on your pager.

  • what if I don't want to use Ajax, but have it occur server-side (for search engines / users without javascript)? Jan 26, 2012 at 20:11
  • You have to change the pager.inc or override its function because page by default use $_GET and you need it POST function pager_find_page($element = 0) { $page = isset($_GET['page']) ? $_GET['page'] : ''; $page_array = explode(',', $page); if (!isset($page_array[$element])) { $page_array[$element] = 0; } return (int) $page_array[$element]; }
    – Ahmed
    Jan 26, 2012 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.