Module that filters posts including or excluding a tag no longer working

I have a module I wrote that can either show posts with a tag or posts that don’t have a tag. Everything was working fine and overnight it’s no longer working.

It doesn’t load the only featured posts at all, and the all posts except featured is just showing everything including things tagged featured.

{{ module.tag }} and {{ tag }} both output the desired tag that was selected in the module on the editor screen.

Support is not any help, they said it’s a coding problem and they don’t support it. It was literaly working yesterday with no changes made in months.

Any clue what could be wrong?

Only featured posts:

{% if module.display == “featured” %}
{% for content in contents %}
{% for topic in content.topic_list %}
    {% if topic.name == tag %}

*** rest of my code ***

Everything but featured posts:

{% if module.display == “except_featured” %}
{% for content in contents %}
    {% unless tag in content.topic_list|map(‘name’) %}

*** rest of my code ***

Hi @fair,

To confirm, is this filter on a blog listing page or in a custom module embedded on a site or landing page?

Unless you update the blog posts per page setting (from blog settings), the {{contents}} hubL tag won’t return all blog posts at once.

This is a custom module that I’ve embedded on a non-blog listing page (just a regular page).

This is the page in question.

It is only showing the second group of posts which should have everything EXCEPT featured. Currently just showing all posts. Above should show posts that are tagged featured, but right now it’s completely blank.

This is how the top section should look:

This is my blog listing page, which works as expected without any issues.

I’m not sure what you mean by this:


@GiantFocal wrote:

Unless you update the blog posts per page setting (from blog settings), the {{contents}} hubL tag won’t return all blog posts at once.


They mean that the {{contents}} variable only holds the limited number of posts defined in your blog’s “posts per page” setting and is typically empty on non-blog pages, which is why your module suddenly stopped finding any posts to filter. — Jaycee

As @Jaycee_Lewis mentioned,

HubSpot’s blog listing {{ contents }} hubL uses pagination; it doesn’t return all blog posts at once. So unless you change the posts per page setting to show all your posts at once, your module won’t work as intended.

Hi GiantFocal. Stepping in here for Fair while she’s OOO. This is for the custom module at the top of the blog listing page for riareflections.com. It worked as intended for several months then overnight stopped. Now the page shows “Latest Stories” without any ‘featured’ blogs at the top. The custom module use to display like this:

Hi @KGreer ,
Thank you for reaching out to the Community!
I’d like to invite some community members who are subject matter experts to join this conversation.
@kosalaindrasiri @GiantFocal @GRajput - Would you be able to share any insights on this? Your expertise would be greatly appreciated.
Best regards,

Appreciate it, Victor_Becerra!

Thanks for the mention @Victor_Becerra,

@KGreer, is this issue solved?
I think you received the advice you are looking for from @Jaycee_Lewis and @GiantFocal.

Please let me know if that’s not the case.

Regards,

Hello, unfortunately the issue is not resolved. The code had worked as expected from Nov 2024 until June 26, 2025. It stopped working overnight June 25/26. The code is not complicated. I had hoped it was a hubspot glitch and would resolve on its own but riareflections.com is not displaying the top custom module as the example screenshot shows (3 hero blogs above “Latest Stories” on the home page). Do you know of anything on hubspot’s end that would no longer allow the code to work as expected?

Only featured posts:

{% if module.display == “featured” %}
{% for content in contents %}
{% for topic in content.topic_list %}
    {% if topic.name == tag %}

*** rest of code ***

Everything but featured posts:

{% if module.display == “except_featured” %}
{% for content in contents %}
    {% unless tag in content.topic_list|map(‘name’) %}

*** rest of code ***

@GiantFocal and @Jaycee_Lewis we discovered why it wasn’t working as expected (after working for several months without issue). In a nutshell, HubSpot made a change on their end: topic.name doesn’t work anymore – it should now be topic.slug. Once the code was updated, it worked as expected.