getgrav / grav-skeleton-blog-site

Grav Blog Site Skeleton
https://getgrav.org
MIT License
50 stars 58 forks source link

Breaking Pagination? #2

Closed bobrocke closed 9 years ago

bobrocke commented 9 years ago

The v1.3.1 update to the pagination plugin fixed the problems with it for the antimatter theme. But if the theme is switched to bootstrap, more odd problems occur.

To a fresh blog skeleton, I gpm installed bootstrap and switched the theme to it. I set the blog page to show 3 articles. The gives me three pages shown in the pagination block at the bottom of the page.

From page one, the urls to page 2 and 3 in that pagination blog are fine.

But it if click on 3 for page three, I get to page 3, but some of the remaining links in the pagination are wrong. Page 2's link is fine. But page 1's link is http://www.grav.dev/page:3.

The left arrow is correct as http://www.grav.dev/page:2 but using it to go to page 2 leaves the left arrow url at http://www.grav.dev/page:2. The 1 in the pagination block points to http://www.grav.dev/page:2, when on page 2, also.

rhukster commented 9 years ago

Probably more a problem with the boostrap theme than the blog skeleton. Can you put this issue there please?

bobrocke commented 9 years ago

I can move it, but maybe I need to move it to the Paginate plug-in? The same weirdness happens with the Grav Team theme Striped (on a clean blog skeleton install) and my own theme on my site.

Of the several themes I've tried, only Antimatter works as expected.

rhukster commented 9 years ago

Bootstrap with latest Grav, Bootstrap theme, + Pagination works fine for me:

http://demo.getgrav.org/bootstrap-skeleton/

also striped:

http://demo.getgrav.org/bootstrap-skeleton/

How is it breaking for you? It might be related to running at root only. I don't have a test install with these as root currently.

bobrocke commented 9 years ago

Hmm. Your demo sites work fine for me, too.

My install is a standard blog skeleton install with bootstrap and stripe added via gpm install. It's at http://www.grav.dev/ served locally via MAMP PRO on Apache and PHP 5.4.42.

When I'm on page 2, my pagination looks like this:

bootstrap

You can see that the back arrow links to page:2 as does the 1 item.

How can I dig into this more to describe the problem better?

rhukster commented 9 years ago

what does the source look like for the pagination?

bobrocke commented 9 years ago

Ask that a different way? What part of the source?

rhukster commented 9 years ago

home grav 2015-08-30 08-50-10

rhukster commented 9 years ago

Your browser interprets the link when it provides you the preview, but it doesn't actually display the generated link, which is the important part when trying to determine what is going on.

If the browser doesn't understand the link, it merely shows as the current page (what you pasted)

bobrocke commented 9 years ago

When on page 2:

home grav

Weird hrefs.

rhukster commented 9 years ago

Oh I think I know what the problem is.. I put a fix into the pagination.html.twig to remove double '//' and that is probably overridden in both bootstrap and striped, so those themes will probably need an update to reflect the fix.

Also, probably need to actually "View source" when having a problem, and find the section of code. Rather than the inspector, which has already 'interpreted' the code.

bobrocke commented 9 years ago

View source is messy! :)

<ul class="pagination">
                    <li><a rel="prev" href="">&laquo;</a></li>

                                <li><a href="">1</a></li>

                    <li><span>2</span></li>

                <li><span>&raquo;</span></li>
    </ul>

Maybe that's the problem as I have it with my site, too and I override pagination.html.twig. I'll experiment a bit more by using the default pagination.html.twig instead...

bobrocke commented 9 years ago

Wait! Bootstrap does not appear to override pagination.html.twig.

rhukster commented 9 years ago

yah doesn't might be something else with your theme then.

bobrocke commented 9 years ago

But I get the problem on a clean skeleton install using bootstrap.

rhukster commented 9 years ago

i'll have to look at it later.. got chores to do today and wife is calling :)

bobrocke commented 9 years ago

OK. No worries...

bobrocke commented 9 years ago

Fixed by the latest Grav updates and corrections to my theme templates to match newest antimatter templates.