olalonde / handlebars-paginate

Pagination helper for Handlebars.
http://syskall.com/pagination-with-handlebars/
59 stars 21 forks source link

Support for URL to be passed in and full URL to be returned. #25

Closed kgrigor closed 8 months ago

kgrigor commented 5 years ago

I had the need to pass in URL so I don't have to add logic in every page where I also have search feature. Pull request introduces a feature where you can pass in URL to the helper and it will construct the correct URL and return its href, while maintaining other parameters you have in the URL.

Usage:

n is still part of the returned object and can be used as necessary.

jimf commented 5 years ago

Hi @kgrigor. Sorry for the late response. I just got back from vacation. Would you mind providing some more info on your use case and what you're trying to simplify?

kwabena53 commented 4 years ago

Hi @jimf, I think @kgrigor 's additions is helpful when you want to implement say a search on a page using a GET request.

So for instance if I want to show the second page of a list of US schools located in Philadelphia, my URL will be: localhost/schools?location=philadelphia&page=2

But for simply displaying the second page of a list of US schools, it will be: localhost/schools?page=2

As with the current version.

I hope this presents a good use case.