Hello everyone, I'm trying to add pagination to a blog and press templates. I tried using this example, but it only changes the featured blog post and not the listing. Any help is appreciated.
It looks like you're not using the standard blog contents loop e.g.
{% for content in contents %}
{# post template goes here, {{content.name}} etc. #}
{% endfor %}
It looks like instead you're using:
{% set articles = blog_recent_posts(module.blog_field, module.count ) %}
{% for blog in articles %}
{# post template goes here, {{blog.name}} etc. #}
{% endfor %}
You wouldn't be able to paginate across blog_recent_posts. At least not in a straightforward way.
It seems your featured post is using the standard content loop. That'd be why it's changing when you add the pagination.
I'm not 100% certain but a simple fix might be replacing the second occurence of
I did not create the template, but with both of the suggestions, I will try to update the template to use the standard content loop and get back with an update.
It looks like you're not using the standard blog contents loop e.g.
{% for content in contents %}
{# post template goes here, {{content.name}} etc. #}
{% endfor %}
It looks like instead you're using:
{% set articles = blog_recent_posts(module.blog_field, module.count ) %}
{% for blog in articles %}
{# post template goes here, {{blog.name}} etc. #}
{% endfor %}
You wouldn't be able to paginate across blog_recent_posts. At least not in a straightforward way.
It seems your featured post is using the standard content loop. That'd be why it's changing when you add the pagination.
I'm not 100% certain but a simple fix might be replacing the second occurence of
Hi @Teun, Thanks for your reply! I tried the code but it does the same thing, it only has 2 pages and when I click page 2 it only changes the featured blog post and not the listing.