Below the listing, I have a popular article block. It's the same custom module for both blogs, lets call them Blog A and Blog B
This is the loop which generates the popular listing :
{% set pop_posts = blog_popular_posts(module.blog_id, 2) %}
{% for pop_post in pop_posts %}
{{ pop_post.publish_date_localized }}
<h3><a href="{{ pop_post.absolute_url }}">{{ pop_post.name }}</a></h3> .... The huble continues...
{% endfor %}
I pasted only the huble part whitout the html. As you can see the goal is to have only two articles showing (the "module.blog_id" is the huble text field which contains the blog id, I need it in order to use the same custom module on other blogs).
The thing is that it works for one blog : Blog A, but it doesn't for Blog B, which is strange because it's the exact bit of code for both.
I checked :
- If the correct id is used for each blog
- The loop seems to work
- I clicked on as many as articles as possible to generate "popularity"
- The only way to get an article to show up on Blog B is to change the number of articles to show from 2 to 4, and I get only one article showing with this method on Blog B, but 4 on Blog A (obviously 🙂 ).
That behavior sounds a little off. Could you link me to the blog(s) / module? I can take a look at the code and see if maybe something needs to be taken a look at by and engineer.
Thanks for that. I looked through what you pasted and I'm not seeing any syntax errors. Assuming the blog ID is correct I'd expect that to work. Do both blogs live in the same HubSpot account? If the one that's not working actually lives in a different account, it wouldn't be accessible to the blog_popular_posts() function. But other than that, I'd expect this to work.
Could you link me to where the actual module lives? Or a live blog page? I'd be able to log in that way. Feel free to send me a direct message if you'd like.