Hello, I have a bit complex code in main-product section. there’s a lot of nested elements to adjust styles on desktop and mobile. so for example for title and price I have something like this
{{ title }}
{{ vendor }}
{{ price }}
this is just a basic example, the code is actually nested more than that. and it’s required to be like this for style needs.
so I want to support blocks and I see in dawn theme it doesn’t have any nested HTML within blocks so it goes with each case normally, but in my case how would I go for supporting blocks? here’s my initial code to support blocks but it won’t work because case & when can’t be in nested HTML.
{%- for block in section.blocks -%}
{%- case block.type -%}
{%- when 'title' -%}
{{ title }}
{%- when 'vendor' -%}
{{ vendor }}
{%- when 'price' -%}
{{ price }}
{% endcase %}
{% endfor %}
Of course this won’t work and here’s where I need your help, I can’t flatten my html to be without nesting.. so how can I support blocks?


