Jump to content

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:

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().

  • 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.

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...