Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
I have a snippet file called 'SHLTR_mf-product-info.liquid'
This is designed to be added to the main-product section as a block.
In main-product.liquid I have defined this in the schema as
{ "name": "Metafield product info", "type": "mf-product-info", "limit": 1 },
This is then referenced in the main body of main-product.liquid with
{% when 'mf-product-info' %} {% render 'SHLTR_mf-product-info' %}
However, whenever I add the block in the customiser I get an error that says "Invalid value for type in block 'dcaa088a-5259-4268-98db-a8224ae20493'. Type must be defined in schema'
It will render the block but the moment you hit save it disappears again.
Does anyone know why this happening?
Hi @jake_mitchell ,
if you using blocks and use {% for block in section.blocks %} and {% case %} {% when %}
then you can use
{% when 'Metafield product info' %}
one important
You want to use "type mt-product-info" then on the main-product. liquid you need to declare formats before use
Declare in main-product.liquid with blocks and use in product.json with format through blocks and block_order
Hope my solution works perfectly for you!
Best regards,
Oliver | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
PageFly - #1 Page Builder for Shopify merchants.
All features are available from Free plan. Live Chat Support is available 24/7.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025