Need support code to link articles via tag

Topic summary

Goal: use template code to show “Read More” links to other articles that share at least one tag with the current article.

Current behavior: the code only pulls related articles from the same article category/blog, not from other categories/blogs.

Code context: loops over the current article’s tags and then over articles from blogs[blog.handle].articles (also tried blog.articles). It filters where related_post.tags contains the tag and excludes the current article by handle.

Attempted change: replaced blogs[blog.handle].articles with blog.articles; behavior unchanged (still limited to the same category).

Environment: Sense 3.0.0 theme.

Open question: how to retrieve and link articles with matching tags across different categories/blogs rather than only within the current one.

Status: no solution or action items provided yet; discussion remains open.

Summarized with AI on January 31. AI used: gpt-5.

Hello everyone. I have a piece of code

{% if article.tags.size > 0 %}

  <div class="related-posts">

    <h3>Read More:</h3>

    <ul>

      {% for tag in article.tags %}

        {% for related_post in blogs[blog.handle].articles %}

          {% if related_post.tags contains tag and related_post.handle != article.handle %}

            <li><a href="{{ related_post.url }}">{{ related_post.title }}</a></li>

          {% endif %}

        {% endfor %}

      {% endfor %}

    </ul>

  </div>

{% endif %}

This code has the effect of creating internal links between articles with the same tag as read more . I have a problem. If I put this code on the website it worked. But it only retrieves articles with the same post category. As for the articles that are not in the same category of articles, it will not be retrieved. I changed the code blogs[blog.handle].articles to blog.articles. But it still doesn’t work. I use Sense 3.0.0 theme

Can someone help me with this problem.

Thank you!