Multipole Block fields works on admin but not rendering both fields in the block

Highlighted
New Member
1 0 0

Hi,

 

Trying to use block element to render a title and text,

This works fine on the admin and I can see 2 fields populated for every new block, but I can't seem to be able to access both fields

 

This is my simple code, the problem here is that block.type never seems to be anything but "text" and I can't access the second field value,

 

{% for block in section.blocks %}
<div class="grid-item" {{ block.shopify_attributes }}>
{% case block.type %}
{% when 'text' %}
{{ block.settings.because_title }}
{% when 'richtext' %}
{{ block.settings.because_textarea }}
{% endcase %}
</div>
{% endfor %}

 

This is my schema

 

{% schema %}
{
"name": "Section because",
"settings": [
{
"id": "because",
"type": "richtext",
"label": "Because Title"
}
],
"blocks": [
{
"type": "text_blocks",
"name": "Title and text",
"settings": [
{
"id": "because_title",
"type": "text",
"label": "Small Title"
},
{
"id": "because_textarea",
"type": "richtext",
"label": "Textarea"
}
]
}
]
}
{% endschema %}
0 Likes
Highlighted
Excursionist
10 0 4

The only block type defined is "text_blocks".

"richtext" and "text" are the types of the fields within the block (notice those are defined in the block's settings).

If my answer was helpful then please Like and Accept Solution :)
1 Like