Help making: "If page title equals x then y"

Topic summary

A developer working with Shopify’s Dawn theme wanted to display related blog posts while excluding the currently viewed article from the recommendations.

Initial Challenge:

  • Attempted to filter articles by comparing article.title with itself
  • Struggled with the correct syntax for conditional logic in Liquid templating

Solution Found:

  • Use page_title instead of article.title for the comparison
  • Implement the condition: {% if article.title != page_title %}
  • This successfully prevents the current article from appearing in the “further reading” section

Technical Details:

  • Uses article-card.liquid component to render blog post cards
  • Pagination set to display 6 articles at a time
  • The issue was resolved by the original poster without additional community input
Summarized with AI on November 14. AI used: claude-sonnet-4-5-20250929.

Dawn theme, I am displaying further reading on my blog page by linking 'article-card.liquid" to show more blog posts to read.

I don’t want to recommend the same blog to the the current one. My idea is to link them by title, since the title of the page is {{ article.title }}, so i am trying to code something like {% if articles == '{{ article.title }} %} then don’t display.

Here is my code trying to achieve this:

{%- paginate blog.articles by 6 -%}
      {%- for article in blog.articles -%}
{% if articles == '{{ article.title }} %}
*action*
  {% else %}
          {%- render 'article-sidecard', article: article -%}
{% endif %}
      {%- endfor -%}
{%- endpaginate -%}

Any idea what else i need to add or edit to make this work.

Thanks.

I have figured it out, unsure how to delete a post so I will just post the answer here. I needed to use page_title rather than article.title, like this:

{%- paginate blog.articles by 6 -%}
  {%- for article in blog.articles -%}
    {% if article.title != page_title %}
      {%- render 'article-sidecard', article: article -%}
    {% endif %}
  {%- endfor -%}
{%- endpaginate -%}