Pagination on custom feed

cos

#1

Hello,

So I have 2 blogs, /blog/ and /news/ I want to display a feed that has both combined into one. I followed this tutorial to create the feed, but I can not get pagination to work.

I tried this, but it defaults to main blog (/blog/)
<ul class="pager">
{% if last_page_num %}
<li>
<a href="{{ blog_page_link(last_page_num) }}">&larr; Previous Page</a>
</li>
{% endif %}
<li>
<!--<a class="all-posts-link" href="{{ group.absolute_url }}/all">All posts</a>-->
</li>
{% if next_page_num %}
<li>
<a href="{{ blog_page_link(next_page_num) }}">Next Page &rarr;</a>
</li>
{% endif %}
</ul>

please any help, my boss wants this done before 9/4.

Thanks,
Vinny


#2

Hi @iamcenz,

That technique does not support pagination. Pagination settings in HubSpot will only apply to standard blog listings; you’d need to use Javascript to paginate the posts. You might consider implementing something like this: http://pagination.js.org/


#3

Hello @Derek_Gervais,

So how exactly would I use this with the HubL code?

Thanks,
Vinny


#4

Hi @iamcenz,

I’m not familiar with the implementation since pagination.js is a 3rd party library. Based on the documentation it appears that it takes an array/object of values and then allows you to page through the contents of the array. You could provide the ‘combined’ posts to this plugin to provide pagination.