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.
Great API.
One problem I'm having though. Currently the first NID in the group lists the previous NID as "0" and the last NID lists the next NID as "0" and so fails when used in a theme. It would be great if it could intelligently link in a circle or "ring" and make the final NID's "next" = the first NID and the first NID's "prev" = the last NID.
Comment | File | Size | Author |
---|---|---|---|
#3 | cycle_or_ring-936760-3.patch | 2.61 KB | jimmyko |
Comments
Comment #1
tseven CreditAttribution: tseven commentedHere is a workaround to achieve the circular prev/next.
Around line 420 in prev_next.module
After:
Insert:
I've done some basic testing, and it seems to work fine. I have not tested it using the views functionality though.
I'm too tired at the moment to create a patch, but perhaps I will at a later date.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedAny chance of this being in the 7.x version? would be awesome....
Comment #3
jimmyko CreditAttribution: jimmyko commentedI have made this feature based on the patch I submited in #1 comment in #614592: Make indexing taxonomy aware. But the logic is similar to the one provided by tseven.
If anyone want to try this patch. Please apply the patch in #1 comment in #614592: Make indexing taxonomy aware first.
Comment #4
meecect CreditAttribution: meecect commentedI've pasted some code below that will work. It doesn't have the bells and whistles of the patch above, ie, there are no admin screens for configuring it, but that should be a simple addition. This code goes in around line 575 or so in prev_next.module.
As soon as I get a chance, I'll roll a proper patch
Comment #5
bhosmer CreditAttribution: bhosmer commentedWith the upcoming limited support for Drupal 6, let's move this out and take care of it in 7.
Duplicated here: https://www.drupal.org/node/1985666