getgrav / grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony
https://getgrav.org
MIT License
14.57k stars 1.41k forks source link

pagination.next_url returns wrong URL? #45

Closed bobrocke closed 10 years ago

bobrocke commented 10 years ago

Both on my test site and the Grav blog site, it seems that pagination.next_url is returning the wrong URL. In both cases the lines:

    {% if pagination.hasNext %}
        <li><a href="{{ base_url }}{{ pagination.next_url }}">&raquo;</a></li>
    {% else %}
        <li><span>&raquo;</span></li>
    {% endif %}

in pagination.html.twig will create a link back to /blog, instead of /blog/page:2, under the next page arrow.

rhukster commented 10 years ago

Your blog is not paging? what version of Grav are you running? Just tested on the demo and it's fine: http://demo.getgrav.org/blog-skeleton/

bobrocke commented 10 years ago

When I click on the "next page" arrow on the bottom of the demo sites home (blog) page paginator, I hit the link http://demo.getgrav.org/blog-skeleton/blog. Don't you?

And shouldn't that be http://demo.getgrav.org/blog-skeleton/blog/page:2?

rhukster commented 10 years ago

Actually your right! I was hitting the numeric button. I'll take a look. Thanks

rhukster commented 10 years ago

Was a bug in the pagination plugin. The template file was just out of date with a method name change.

Probably easier just to change the template file with this one:

https://github.com/getgrav/grav-plugin-pagination/blob/develop/templates/pagination.html.twig

will replace your user/plugins/pagination/templates/pagination.html.twig file

bobrocke commented 10 years ago

That was fast! You guys sure are right on top of it. Another "selling" point for Grav.

Oh, yes, that fixed it. :)

rhukster commented 10 years ago

We would of fixed it quicker, but our GitHub notifications in HipChat stopped working for a bit, so we didn't notice this issue reported for nearly 20 minutes!

w00fz commented 10 years ago

Cross reference:

bobrocke commented 10 years ago

I notice that the Grav blog at http://getgrav.org/blog has the same error. The "next page" pagination arrow links to: http://getgrav.org/blog. The page number links and the "last page" arrow are fine.

w00fz commented 10 years ago

Fixed both getgrav.org/blog and demo.getgrav.org/blog-skeleton/blog.

Cheers!