1

I'm not good in programming and I stuck on making infinite scroll on my website.

Right now I have the code for pagination that looks like this:

    {% set query = craft.entries()
    .section('articles')
    .type('naujienos')
    .limit(15)
     %}

{% paginate query as pageInfo, pageEntries %}

{% for entry in pageEntries %} {% include 'blocks/_article-with-text.three' %} {% endfor %}

</div>

{% if pageInfo.prevUrl %}<a href="{{ pageInfo.prevUrl }}">Previous Page</a>{% endif %} {% if pageInfo.nextUrl %}<a href="{{ pageInfo.nextUrl }}">Next Page</a>{% endif %}

It's very much the same as in Craft CMS documentation and I checked all the topics that are in here but couldn't make it work for me. Maybe someone can help me out please?

1 Answers1

1

To produce an "infinite scroll" like behavior, you'll need to go further than just pagination with TWIG. You'll need to implement some JavaScript. Metafizzy's Infinite Scroll might be appropriate.

This question has answers that could help you: Infinite scrolling with Craft?

John
  • 73
  • 4