Hola! ¡Tenemos nuestra Comunidad en Español!

Hubspot related post filtering also loading posts from from two different blogs

Top Contributor

Hi developers

I am trying to get the related posts from the blog using  related_blog_posts 

here is my code

<div class="post-bottom-content">                   
{% macro blog_post_formatter(blog_post) %}  
        <div class="prev-post cm-posts span6">
                <p>
                  <a class="previous-posts-link" href="{{ blog_post.absolute_url }}">
                    <img src="{{ blog_post.featured_image }}" alt="{{ blog_post.name }}">
                    {{ blog_post.name|striptags|truncate(300, breakword=False, end='...') }}
                  </a>

                </p>
              </div> 
{% endmacro %}
        
{% set tagNames = content.tag_names %}
  {{ tagNames }}
{#	Add this to the function and use HubSpot's JOIN filter to turn the array into a comma separated string	#}
<div class="recent-post-listing next-prev-posts">
<div class="recent-listing">
{% related_blog_posts blog_ids="xxxxxxxx" post_formatter="blog_post_formatter" limit="4", tags="{{ tagNames|join(',') }}" %}
</div>
<div style="clear:both;"></div>
</div>

</div>

I have added the blog ID to fetch the posts from a single blog, but its also loading posts from other blogs too, I didn't understand why this issue occurs even after I have added a particular blog ID. can anyone please help me to solve this situation? waiting for the reply

 

Thanks

Reply
0 Upvotes
2 Replies 2
HubSpot Product Team

Hey there! This certainly seems odd- any chance you could send me a link to the blog you're testing this on (it's okay if the code isn't live) and I'll try to dig in a little deeper?

Reply
0 Upvotes
Highlighted
Occasional Contributor

I'm having the same issue, even with the most simple syntax : 

 

{% related_blog_posts, blog_ids="7734291241" %}

 

 

 

Reply
0 Upvotes