There should be two parts, the EE template serving up content that responds to pagination (the API), and the javascript that loads and inserts that content when the viewport hits a spot in the viewport, while keeping track of pagination. InteractionObserver is the JS part that watches the viewport. Which part are you stuck on?
Currently using <https://infinite-scroll.com> which works kind of in that it scrolls but can’t get it to respond to the pagination Pxx values properly. It just scrolls endlessly repeating data after total entries has been reached. The pagination URL (Next page link) get stuck on P15 and doesn’t update when scrolling, when P30 and P45 exist.
I’ve been looking at it too long, it’s probably something simple but I can’t see the wood for the trees!
Hm, maybe the path? What do you have for that?
Their example has this:
path: 'news/blog-p{{#}}.html'So does it need to be
path: 'new/P{{#}}'Yeah. The basic issue is that EE doesn’t use page numbers; it uses an offset. So you can’t use Infinitescroll’s {#} to auto-determine the next page. You have two choices:
<a href="/page/2class=pagination__next">Next</a>
path: '.pagination__next'limit= …:path: function() {
let fetchNumber = ( this.{absolute_count} + 1 ) * {limit};
return `/articles/P${fetchNumber}`;
}<https://infinite-scroll.com/options#path>
So I tested the {{#}}version, no joy obviously because of the offset thing Travis!
Tried the path:function method - no luck
The path: 'pagination__next' method works the first time scroll is activated but after that the next page pagination link doesn’t update because the page isn’t refreshed to get the /Pxx slug into the URL.
Scratching my head on this one!
Thanks for your help Travis.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.