Jump to content
thetuningspoon

Change how many page numbers to show between ellipses in pager

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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:

2019-07-09_102603.png.5adf9f36836e5aff946dd996a9ab8f85.png
Why is the current page the last number and not the middle number?

2019-07-09_102721.png.2611b4097431931ee3ea7a2c4bcdb79e.png
Why are there only two numbers here instead of three?

2019-07-09_103053.png.bc46703d5ea6c5e71b53d40521e46c94.png
Likewise here - why aren't there three numbers in addition to the first and last numbers?

Why does the second page look like this...
2019-07-09_102900.png.107ced5f4370dfedf60fd066d9cd79c6.png
...but the second to last page look like this...
2019-07-09_102922.png.9639d0e59de684724ac2f0c42590f8bb.png
?

If you want to have a go at fixing it the relevant code is in PagerNav::getPager().

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...