How can I hide empty metafields on FAQ pages in Blockshop theme?

Topic summary

A Shopify store owner using the Blockshop theme is creating multiple FAQ pages with metafields and collapsible rows. The issue: some FAQ pages have 10 questions while others have only 5, causing empty metafields to display on pages with fewer questions.

Proposed Solution:
Wrap each metafield in a conditional statement to check if it contains content before displaying:

{% if product.metafields.custom.your_metafield != blank %}
  Your metafield value: {{ product.metafields.custom.your_metafield }}
{% endif %}

Implementation:

  • Locate the existing metafield code in the theme files (specifically page.faq.json or related template files)
  • Add the conditional wrapper around each metafield reference
  • This prevents empty fields from rendering on the page

The discussion remains open regarding the exact file location, though the solution approach has been clarified. An attached image demonstrates the problem but details are unclear from the conversation text.

Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

I am currently using the Blockshop theme and have several different FAQ pages for various types of products. I am utilizing page.faq.json and metafields with collapsible rows to design these pages. Some FAQ pages have 10 questions and others only have 5; how can I get the empty metafields to not show up on the FAQ pages?

Attached is example of the problem I’m running into:

Hello @Novader ,

Find it code and make it conditional.

like this:

{% if product.metafields.custom.your_metafield != blank %}
  

Your metafield value: {{ product.metafields.custom.your_metafield }}

{% endif %}

Thanks

Where should this code be placed within the page’s coding?

No need to place this code.
This code was just for demonstration.
You need to manually find the existing code in the theme files and wrap each metafield with if condition as I did in the example.