Custom block type not rendering in Refresh theme

Custom block type not rendering in Refresh theme

nocoroco
Tourist
4 0 0

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".

Screenshot from 2024-06-29 13-06-08.png

 

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?

 

Replies 2 (2)

TijnTijn
Visitor
1 0 0

I have exactly the same problem, have you made progress in solving your issue?

nocoroco
Tourist
4 0 0

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.