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.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | add_looping-106640-4.patch | 1.84 KB | mattcasey |
Comments
Comment #1
joachim CreditAttribution: joachim commentedI've started a page of examples for this module: http://drupal.org/node/387786
Perhaps you'd like to add this to it?
Comment #2
momper CreditAttribution: momper commentedthanks for posting this ... very helpful ...
Comment #3
valderama CreditAttribution: valderama commentedyeah, thats a nice thing to have, would be cool to see a setting for this behaviour in the module!
thanks + best,
walter
Comment #4
mattcasey CreditAttribution: mattcasey commentedThis 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"
Comment #5
mattcasey CreditAttribution: mattcasey commentedComment #6
naeluh CreditAttribution: naeluh commentedI 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
Comment #7
mattcasey CreditAttribution: mattcasey commentedhm, it's been a long time since I wrote that patch. Did you run update.php?
Comment #8
naeluh CreditAttribution: naeluh commentedyes I did its ok I made a new one in template.php file
but I would like this functionality for this module