rewdy / Pico-Pagination

Provides basic pagination for Pico.
27 stars 12 forks source link

can't be combined with other plugins and dynamic content (like search!) #27

Open ArchI3Chris opened 1 year ago

ArchI3Chris commented 1 year ago

While I had a few issues getting pagination working, I got that done. As far as my setup and testing goes, seems to be working for now.

Now I have a new problem. I've just implemented the Search plugin. Both seem to be working, as long as they are separated. The issue is, I don't see how to combine the two properly. (Maybe it's just me. It's past 4 in the morning).

The issue is, that Pagination filters ahead of time from all pages. Always! I can't just throw the search result in a folder and tell the pagination plugin to go from there. The search results are being created dynamically.

The Search plugin before worked directly with the pages array. Since this caused issues with other plugins as well, they actually noticed the issue, rewrote it in 2020 and now provide a FILTER. So, the search plugin can now be applied to any array/pages that are being thrown at it. That is a great way of handling data.

The issue is, there is no sense in applying the search AFTER pagination. It should be search filter first and pagination of the resulting pages afterwards. Applying pagination as a filter as well would solve the problem.