Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paging runs over edge of screen on Page Archive #45

Open
blakepell opened this issue Feb 2, 2022 · 2 comments
Open

Paging runs over edge of screen on Page Archive #45

blakepell opened this issue Feb 2, 2022 · 2 comments

Comments

@blakepell
Copy link

When there are a lot of entries in an archive, the pager runs off the edge of the screen on both sides. You can scroll to the right to get to the end of the pager but it won't allow you to scroll all the way to the left to get to the first set of pages. I'm attaching a screenshot below to illustrate (you can see the scrollbar can scroll right, but not left). I tested in Edge & FireFox.

image

My workaround currently is to increase the page size so that there are less pages.

@blakepell
Copy link
Author

blakepell commented Feb 2, 2022

On further inspection I see I can update the template Archive.cshtml to change the behavior. This probably isn't ideal for everyone but I set a static length of it for my simple blog. Sharing in case it's useful to anyone else.

@for (var n = Math.Max(1, Model.Archive.CurrentPage - 10); n <= Math.Min(Model.Archive.CurrentPage < 10 ? 11 : Model.Archive.CurrentPage, Model.Archive.TotalPages); n++)
{
    <li class="page-item @(Model.Archive.CurrentPage == n ? "active" : "")"><a class="page-link" href="@BlogLink()/page/@n">@n</a></li>
}

@tidyui tidyui transferred this issue from PiranhaCMS/piranha.core Feb 2, 2022
@axunonb
Copy link

axunonb commented May 27, 2022

I had the same issue and solved it in a similar way. See the sample below. The pager allows any odd number for the size. Guess, this is a common requirement.
@tidyui Would you accept a PR on that

Pagination.mp4

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants