CMS Development

Robert
Mitwirkender/Mitwirkende | Diamond Partner
Mitwirkender/Mitwirkende | Diamond Partner

get most recent posts based on a topic

lösung

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 Akzeptierte Lösung
Tom
Lösung
HubSpot-Produktteam
HubSpot-Produktteam

get most recent posts based on a topic

lösung

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! 

Lösung in ursprünglichem Beitrag anzeigen

4 Antworten
Tom
Lösung
HubSpot-Produktteam
HubSpot-Produktteam

get most recent posts based on a topic

lösung

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
Mitwirkender/Mitwirkende

get most recent posts based on a topic

lösung

@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-Produktteam
HubSpot-Produktteam

get most recent posts based on a topic

lösung

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
Mitwirkender/Mitwirkende

get most recent posts based on a topic

lösung
0 Upvotes