thetuningspoon Posted July 8, 2019 Share Posted July 8, 2019 A client has requested that the pager always show the next page number when the total number of pages exceeds the numPageLinks. This is what it's showing right now when on Page 7: Prev 1 ... 6 7 ... 24 Next This is what they would like: Prev 1 ... 6 7 8 ... 24 Next I think it is a little more intuitive for some people to be able to click on the next page number rather than on the Next button. I looked through the options and didn't see anything for this. I started looking through the code as well to see if I could hack it but I'm having trouble pinpointing where this determination is made. Link to comment Share on other sites More sharing options...
Robin S Posted July 8, 2019 Share Posted July 8, 2019 There's no special setting for the number of page links between the ellipses, but how many appear there is determined by the numPageLinks setting, which as I understand it should control how many extra page numbers appear in addition to the first and last page numbers. So you'd expect that a numPageLinks setting of 3 would achieve what you want, but it seems buggy: Why is the current page the last number and not the middle number? Why are there only two numbers here instead of three? Likewise here - why aren't there three numbers in addition to the first and last numbers? Why does the second page look like this... ...but the second to last page look like this... ? If you want to have a go at fixing it the relevant code is in PagerNav::getPager(). 1 Link to comment Share on other sites More sharing options...
dragan Posted July 9, 2019 Share Posted July 9, 2019 You could try using a pure client-side pagination that turns in-the-middle-ellipsis into a dropdown, like http://flaviusmatis.github.io/simplePagination.js/ Link to comment Share on other sites More sharing options...
thetuningspoon Posted July 10, 2019 Author Share Posted July 10, 2019 Good call @Robin S. I should have done more testing before I started exploring a fix. Maybe this is a core bug. Should I submit an issue report? Link to comment Share on other sites More sharing options...
matjazp Posted August 28, 2019 Share Posted August 28, 2019 @thetuningspoon mind testing with attached PagerNav.php? Possibly not perfect, but it's not clear to me how pagination should be presented on edge cases... PagerNav.php 1 1 Link to comment Share on other sites More sharing options...
thetuningspoon Posted August 28, 2019 Author Share Posted August 28, 2019 Hi @matjazp - I just tested with values of 2, 3, 4, and 5 and it works perfectly ? A value of 1 or 0 should probably be ignored and replaced with 2 as the minimum. Here is the link to the GitHub issue for this: https://github.com/processwire/processwire-issues/issues/969 Do you think you can submit this as a pull request? Link to comment Share on other sites More sharing options...
thetuningspoon Posted August 28, 2019 Author Share Posted August 28, 2019 Just found one possible inconsistency here. On a pager with a numPageLinks value of 3 and 23 pages total (I think the total number is effecting it somehow), the fifth page shows 4 page links between the ellipses instead of 3. See https://www.kba-architects.com/projects/page5 for an example. Link to comment Share on other sites More sharing options...
matjazp Posted August 28, 2019 Share Posted August 28, 2019 43 minutes ago, thetuningspoon said: Just found one possible inconsistency here. On a pager with a numPageLinks value of 3 and 23 pages total (I think the total number is effecting it somehow), the fifth page shows 4 page links between the ellipses instead of 3. Hm, I see 3: 1 hour ago, thetuningspoon said: Do you think you can submit this as a pull request? I don't do PRs as they are not accepted. Ryan finds his way of fixing it. Link to comment Share on other sites More sharing options...
thetuningspoon Posted August 28, 2019 Author Share Posted August 28, 2019 Okay, it must be a caching thing on my end. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now