When using a custom block type or a private block in the schema, the settings object returns empty.

Topic summary

A developer is experiencing an issue where custom blocks within a section schema return empty block.settings objects when looped through. All block types are being identified as @Theme instead of their custom types (text, button, slide), making them inaccessible during iteration.

Proposed Solution:

  • Use {% content_for "blocks" %} instead of looping through blocks
  • Looping is intended for section blocks, not theme blocks

Current Status:

  • The workaround doesn’t fully address the developer’s needs, as preview functionality doesn’t work in section blocks
  • The issue remains unresolved, with the developer hoping Shopify will update theme blocks to function similarly to section blocks
  • Code screenshots were provided showing the implementation attempt
Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

I’m encountering an issue when using custom blocks within a section schema. Specifically, when I loop through the blocks using a for loop and apply conditions, the block.settings object returns as empty ({}). Additionally, all block types are identified as @Theme , and any custom block types are not recognized.

This is affecting blocks like text, button, and slide, which are the intended targets in this section. However, during the loop, these custom types are not accessible as expected.

Has anyone else experienced this or found a workaround? Any guidance would be appreciated!

Hi @mdarifulislam
You don’t need to loop through blocks
You have write it like this

{% content_for "blocks" %}

Using loop is for section blocks not for theme blocks
Thanks!

1 Like

The preview doesn’t work in the section block, so I need to use the Theme block.

Thank you for suggestion. I hope Shopify will update same like Section Blocks for Theme Blocks Soon