CMS Development

Robert
Contributeur | Partenaire solutions Diamond
Contributeur | Partenaire solutions Diamond

get most recent posts based on a topic

Résolue

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 Votes
1 Solution acceptée
Tom
Solution
Équipe de développement de HubSpot
Équipe de développement de HubSpot

get most recent posts based on a topic

Résolue

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! 

Voir la solution dans l'envoi d'origine

4 Réponses
Tom
Solution
Équipe de développement de HubSpot
Équipe de développement de HubSpot

get most recent posts based on a topic

Résolue

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
Contributeur

get most recent posts based on a topic

Résolue

@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 Votes
Tom
Équipe de développement de HubSpot
Équipe de développement de HubSpot

get most recent posts based on a topic

Résolue

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 Votes
sking1
Contributeur

get most recent posts based on a topic

Résolue
0 Votes