CMS Development

Robert
Contributor | Diamond Partner
Contributor | Diamond Partner

get most recent posts based on a topic

SOLVE

I am trying to pull recent blog posts on a blog post itself where the topic is the same one as the current topic.

what is the best solution to do that?

 

 

0 Upvotes
1 Accepted solution
Tom
Solution
HubSpot Product Team
HubSpot Product Team

get most recent posts based on a topic

SOLVE

Hi @Robert

 

You can do this through the topic recent posts filter available here: http://designers.hubspot.com/en/docs/hubl/hubl-supported-functions#blog-recent-topic-posts

 

Hope this helps! 

View solution in original post

4 Replies 4
Tom
Solution
HubSpot Product Team
HubSpot Product Team

get most recent posts based on a topic

SOLVE

Hi @Robert

 

You can do this through the topic recent posts filter available here: http://designers.hubspot.com/en/docs/hubl/hubl-supported-functions#blog-recent-topic-posts

 

Hope this helps! 

sking1
Contributor

get most recent posts based on a topic

SOLVE

@Tom - how can this be extended to a multiple blog listing?

 

 

{% set blog_one_posts = blog_recent_posts('XXXXXXXXXX', limit=3, tags="Marketing Tips") %} <!-- video --> 
{% set blog_two_posts = blog_recent_posts('XXXXXXXXXX', limit=3, tags="Marketing Tips") %} <!-- article -->
{% set blog_three_posts = blog_recent_posts('XXXXXXXXXX', limit=3, tags="Marketing Tips") %} <!-- infographic -->
{% set blog_four_posts = blog_recent_posts('XXXXXXXXXX', limit=3, tags="Marketing Tips") %} <!-- report -->

{% set all_posts = (blog_one_posts + blog_two_posts + blog_three_posts + blog_four_posts) | sort(true, false, 'publish_date')  %} 

Then

 

 

{% for post in all_posts %}
Content here
{% endfor %}

 

0 Upvotes
Tom
HubSpot Product Team
HubSpot Product Team

get most recent posts based on a topic

SOLVE

Hey @sking1 this is somewhat different to this original issue. I'd advise you to open up a new post on our designers community to see if any designers there can assist! 

0 Upvotes
sking1
Contributor

get most recent posts based on a topic

SOLVE
0 Upvotes