APIs & Integrations

aimai123
Member

Get all blog posts exceeding hubl function limit

Hello, 

 

Is there a way to list all blog posts from a blog list exceeding the supported function limit? I want to do something like below, but it only lists the first 200 blog posts. Is is possible to grab all blog posts? 

 

{% set news = blog_recent_posts('5268670713', blog_total_post_count('5268670713')) %}
{% for post in news %}
<div class="post-item">
<a class="post-item__title" href="{{ post.absolute_url }}" style="color: #000;">{{ post.title }}</a>
</div>
{% endfor %}

0 Upvotes
1 Reply 1
lscanlan
HubSpot Alumni
HubSpot Alumni

Get all blog posts exceeding hubl function limit

Hi @aimai123,

 

That's clever to use the blog_total_post_count() function as the 2nd argument to the blog_recent_posts() function, but it won't be possible to exceed any of the function limits. The only real exception that I know of is the contents dictionary on a blog's "all posts" or simple listing page. And in that case I think the limit is 1000 (although I'd have to double check).

 

I don't know if this is really an option in your case, but could you use a plugin like Infinite Scroll (https://infinite-scroll.com/) after the page loads to pull in subsequent pages of posts? If I remember correctly it makes a request for the HTML page and then returns elements that match a selector.

 

Leland Scanlan

HubSpot Developer Support
0 Upvotes