Shopify themes, liquid, logos, and UX
I'm trying to create a custom block type to add it to my product page. I have the block defined in a snippet, with minimal content in snippets/relative_bar.liquid
<p> Testing </p>
This is rendered in the `for block in section.blocks` section of sections/main-product.liquid:
{%- for block in section.blocks -%}
{%- case block.type -%}
{%- when '@app' -%}
{% render block %}
{%- when 'relative_bar'}
{% render 'relative_bar' %}
{%- when 'text' -%}
.. etc etc
Later, defined in the schema in main-product.liquid:
{
"type": "relative_bar",
"name": "t:sections.main-product.blocks.relative_bar.name",
"limit": 1,
"settings": [
{
"type": "text",
"id": "relative_bar_label",
"label": "t:sections.main-product.blocks.relative_bar.settings.text.label",
"default": "t:sections.main-product.blocks.relative_bar.settings.text.default"
},
{
"type": "text",
"id": "relative_bar_left_label",
"label": "t:sections.main-product.blocks.relative_bar.settings.left_label.label",
"default": "t:sections.main-product.blocks.relative_bar.settings.left_label.default"
},
{
"type": "text",
"id": "relative_bar_right_label",
"label": "t:sections.main-product.blocks.relative_bar.settings.right_label.label",
"default": "t:sections.main-product.blocks.relative_bar.settings.left_label.default"
}
]
},
The block shows up fine in the editor, and I can add it to the product page. I'm omitting the contents of en.default.schema.json for brevity, But I cannot for the life of me get the content to actually render. In the screenshot below, you can see the block added to product information after "Share", but there is no rendered content after the div for "Share".
I feel like I"m missing something basic but it's unclear where else I'd need to make edits to actually get a custom block rendering correctly. Any hints?
I have exactly the same problem, have you made progress in solving your issue?
Sadly, no. I just ended up ponying up $300 to get the Shapes theme which included this out of the box. Wasn't worth the headache figuring out the customization and managing it indefinitely.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025