I have a blog post page template, using the related_blog_posts hubl tag at the bottom. However it is not actually pulling posts that are related. I have tried two methods.
This one is just taking the tags of the post, removing the year tag we have, as I only want to use the other tags, and passing that in to the hubl tag. Out of the 3 at most only 1 is actually related.
{% set tags = content.tag_list | join(',') %}
{% set tags = tags | cut('2025') %}
{% set tags = tags | cut('2024') %}
{% set tags = tags | cut('2023') %}
{% related_blog_posts limit=3, tags=tags, tag_boost="100" no_wrapper=True, post_formatter="recent_post" %}
I have also tried using hubl, to get the ids of 3 posts with the first tag, and pass the ID directly into the `blog_post_override` argument. This still does not display the selected posts.
{% set tags = content.tag_list | join(',') %}
{% set filteredTags = [] %}
{% for tag in tags %}
{% set len = filteredTags | length %}
{% if len < 10 and tag != "2025" and tag != "2024" and tag != "2023" %}
{% set tag = tag | lower %}
{% set tag = tag | replace(" ", "-") %}
{% do filteredTags.append(tag) %}
{% endif %}
{% endfor %}
{% set posts = blog_recent_tag_posts("default", filteredTags, 5, "AND") %}
{% set filteredPosts = [] %}
{% for post in posts %}
{% if content.id != post.id %}
{% do filteredPosts.append(post.id) %}
{% endif %}
{% endfor %}
{% set filteredPosts = filteredPosts | join(",") %}
{% related_blog_posts limit=3, blog_post_override=filteredPosts, post_formatter="recent_post", no_wrapper=True %}
I have also tried this without the hubl, and just manually writing in the ids like "id1,id2,id3", still with no luck.
This has fixed it actually displaying the manually filteredPosts, but the "blog_recent_tag_posts" query does not always return related posts now, even after replacing "AND" with "OR" and manually checking that there are posts with that tag that should show.