When on the page 1 of 10, I wanted the Previous link to still appear, and send viewers to page 10 of 10, and same (or vice versa) for the Next, on page 10 of 10 to send users back to page 1 of 10.

In case anyone else is interested in this functionality, I changed the code around line 310 that was

  $vars['previous'] = !empty($nav['prev']) ? l(t('‹ previous'), 'node/'. $nav['prev']) : '';
  $vars['key'] = t('@count of @count_total', array('@count' => ($nav['current_index'] + 1), '@count_total' => count($nav['full_list'])));
  $vars['next'] =  !empty($nav['next']) ? l(t('next ›'), 'node/'. $nav['next']) : '';

to

  $vars['previous'] = !empty($nav['prev']) ? l(t('‹ previous'), 'node/'. $nav['prev']) : l(t('‹ previous'), 'node/'. $nav['last']);
  $vars['key'] = t('@count of @count_total', array('@count' => ($nav['current_index'] + 1), '@count_total' => count($nav['full_list'])));
  $vars['next'] =  !empty($nav['next']) ? l(t('next ›'), 'node/'. $nav['next']) : l(t('next ›'), 'node/'. $nav['first']);

and that did it. Seems like a nice thing to have.

CommentFileSizeAuthor
#4 add_looping-106640-4.patch1.84 KBmattcasey
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

I've started a page of examples for this module: http://drupal.org/node/387786
Perhaps you'd like to add this to it?

momper’s picture

thanks for posting this ... very helpful ...

valderama’s picture

yeah, thats a nice thing to have, would be cool to see a setting for this behaviour in the module!

thanks + best,
walter

mattcasey’s picture

Version: 6.x-1.x-dev » 6.x-1.10-beta1
FileSize
1.84 KB

This patch adds a new schema field and an option in the admin form to loop a pager. It appears below the option to "Reverse the list"

mattcasey’s picture

Version: 6.x-1.10-beta1 » 6.x-1.x-dev
Status: Active » Needs review
naeluh’s picture

Version: 6.x-1.10-beta1 » 6.x-1.x-dev

I tried #4 and it made no change to my admin ui or the module functionality I applied it to the dev and beta 2 6.x is this supposed to work ? thanks

mattcasey’s picture

hm, it's been a long time since I wrote that patch. Did you run update.php?

naeluh’s picture

yes I did its ok I made a new one in template.php file
but I would like this functionality for this module