adding pagination in simple_list_page statement

Hi! I was trying to add a pagination in the simple_list_page statement but based on the documention it was not affected by the post limit in blog settings.

so are there anyways we can generate new pages in this statement or any workaround to add a pagination to it?

here’s what my code looks like as of the moment

Thank you!

{% if tag %}
 {# inside here will be the list of tag related articles #}

 {% elif not simple_list_page %}
 {# inside here will be the homepage of the blog listing #}

 {% elif simple_list_page %}
 {# inside here will be the listing of the /all articles #}
 {% endif %}

@jonchim :waving_hand:Long time no chat!

Any chance you can help out here?

@dennisedson, it’s been a while, we need to catch up!
@FMacaspac, i like using the blog-pagination module that is included in the hubspot boilerplate template, super clean. If you want to create a new boilerplate theme you should be able to pull that module snippet and add it within your simplet list snippet. I believe you will need to include that module snippet 3 times within each if statement.

Hi, @jonchim thanks for the solution. But I think this is not the answer I’m looking for. I’m actually using this pagination for the tag listing page. my main concern is the simple_list_page statement. based on the hubspot documentation The simple listing is not affected by the post limit in Blog Setting
so in this case, how can we use the pagination in this statement if this template markup doesn’t generate new pages?

because I was trying to have an output something like https://blog.pagename.com/blog/all/page/1

Hi @jonchim , would greatly appreciate for your help in answeing this for us, we’re able to use pagination successfully on listing pages with specific tags.
However, what we’re trying to do is to have a listing page returning “all-posts” with paginations.
Please advise if we’re heading into wrong direction, thank you!

hey @lindahl, @FMacaspac ,

Sorry for the delay here! so it looks like inside of your simple listing if statement

{% elif simple_list_page %}

you should be able to set X amount of posts to show and from there it should take the pagination if that is also included in the if statment

{% set posts = blog_recent_posts('default', 5) %}
{% for post in posts %}
 <h3><a href="{{ post.absolute_url }}">{{ post.name }}</a></h3>
 <img src="{{ post.featured_image }}" alt="{{ post.name }}">
{% endfor %}

Not sure if this link is helpful, but give it a shot

Also if it’s not doable you might be able to use javascript in that simple listing

Hi @jonchim thanks for the precious feedback.

I’ve talked to the HubSpot internal team and they mentioned with the use of `simple_list_page`, it’s not quite possible to have pagination inside it. They’ve also updated the document. So the best way to do with it is to have the javascript pagination.

All good and thanks again for your reply. :slightly_smiling_face:

Hi @FMacaspac ,
Refer to this for making pagination https://designers.hubspot.com/code-gallery/entry/us/dontgojasonwaterfalls-blog-numbered-pagination , Just add this code at bottom of your listing.

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regards.