Help Needed: Displaying Selected Blog Posts in Blog Sidebar using Metafields — No Results showing

Hi everyone :waving_hand:

We’re currently customizing our Shopify blog page (using Dawn theme 15.3) and trying to display a handpicked selection of older but valuable blog posts (for SEO and user engagement) in a sidebar module labeled Top Picks or Top Stories — shown alongside our blog articles.

What We’re Trying to Achieve:

We want to manually feature specific blog articles in the blog sidebar, independently from the main blog feed (which is sorted chronologically).
The idea is to highlight a few standout posts that otherwise get buried over time — for example:

  • “Top Picks” = Older articles we want to feature manually
  • “Top Stories” = Articles tagged as “top” in a metafield

What We’ve Set Up:

We’ve created two blog post metafields in the Shopify admin:

  1. Top Picks
    → Type: True or false
    → Namespace & key: custom.top_picks
    → Marked as “True” on 9 different blog posts
  2. Top Stories
    → Type: Single line text with a preset value of top
    → Namespace & key: custom.top_stories
    → Assigned to 1 blog post

Both metafields are marked as “Definition pinned”, and the corresponding blog posts have been edited to include the correct values.

Code We’re Using in a Custom Liquid Block (Sidebar)

For custom.top_picks (boolean):

{% assign top_posts = blogs[‘poster-chronicles’].articles | where: “metafields.custom.top_picks”, true | slice: 0, 5 %}> > ### Top Picks> > {% if top_posts.size > 0 %}> {% for post in top_posts %}> - {{ post.title }}
{% endfor %}> {% else %}> - No Top Picks Found> {% endif %}>

For custom.top_stories (text = “top”):

{% assign all_posts = blogs[‘poster-chronicles’].articles %}> ### Top Stories> ****> {% for post in all_posts %}> {% if post.metafields.custom.top_stories == “top” %}> - {{ post.title }}> {% endif %}> {% endfor %}> **
**

Problem:

Despite confirming that:

  • The metafields are properly defined
  • The blog handle is correct (poster-chronicles)
  • Posts are assigned the correct metafield values
  • Other loops using blog.articles work fine (like recent posts)

:backhand_index_pointing_right: Both of the above blocks return “No Top Picks Found” / “No Top Stories Found”.

We’ve tried switching metafield types, rewriting conditions, toggling the Storefront API checkbox… but nothing seems to work.

Our Questions:

  • Are blog.articles metafields accessible inside a custom liquid block?
  • Is metafield filtering supported this way in Dawn or OS 2.0?
  • Is there a known issue with metafields on blog objects not being accessible via Liquid?

Any guidance or shared experience would be hugely appreciated :folded_hands:

Thanks in advance!

— Alecse

Founder of MyRetroposter.com

Hi,

Possible Reasons for Failure

  • Metafields may not be directly accessible in blog.articles
  • Metafields might be Empty in Liquid Output
  • Metafields data types must match exactly
  • Check your metafield setup

Rewrite your code to ensure proper metafield retrieval.

Code example

{% assign all_posts = blogs['poster-chronicles'].articles %}
{% assign top_posts = all_posts | map: "metafields" | map: "custom" | map: "top_picks" %}

### Top Picks

{% assign count = 0 %}
{% for post in all_posts %}
  {% if post.metafields.custom.top_picks == true %}
    - {{ post.title }}

    {% assign count = count | plus: 1 %}
  {% endif %}
{% endfor %}

{% if count == 0 %}
  - No Top Picks Found
{% endif %}

Thank you so much! I tried your rewritten code and it works exactly as intended! Have a great day!