-2

I am looking for a way to automatically load the next article once a reader has scrolled to the bottom of the page. Something similar to what this wordpress plugin is doing. So I understand that the functionality need to do three things:

  1. Detect that the user has scrolled to the bottom of the page, and then load the next page underneath it, without breaking the theme's structure.
  2. When the user has scrolled on to the next article, the URL and title on the browser should change to reflect that the user is now reading a new article.
  3. The new page view should be trackable by google analytics. This should also create a separate history entry on the user's browser. Any social media share after the scroll should reflect the second article and not the first.

I understand there may be a way to achieve this using views infinite scroll. But that won't be able to achieve conditions two and three.

1
  • Apart from your post not containing any specific question, Drupal Answers is not the right place to ask for recommendations (see drupal.stackexchange.com/help/on-topic to find out about what to ask here). To my knowledge, your use case can't be covered by any contrib module alone. But you can easily achieve what you are looking for by some custom coding (e.g. extending views infinite scroll). If you stumble upon a specific issue while you are doing it yourself (e.g. something not working as expected), feel free to come back with this more specific question. Commented Aug 3, 2018 at 12:47

1 Answer 1

0

After a lit bit more looking around, I found that this functionality can be achieved by the Infinite Scroll js plugin. There is no out of box integration with Drupal yet, however, it shouldn't be too hard to build one. This plugin takes care of conditions 2 and 3 mentioned in the question quite nicely. It has the added advantage over the "views infinite scroll module" in that the content can be rendered without using views, and hence is a more flexible option.

Not the answer you're looking for? Browse other questions tagged or ask your own question.