Custom Liquid issue With Theme

Topic summary

A user needed to display metafield data on product pages using custom Liquid code but couldn’t find the “Custom Liquid” block option in their theme’s product information section.

Initial Problem:

  • One store had a built-in “Custom Liquid” option that worked perfectly
  • Another store lacked this option despite following a tutorial to add it
  • The user could create a custom liquid section but needed it as a block within an existing section

Key Code Needed:

{% if product.metafields.custom.stock_eta %}
<p style="font-size: 16px;">Re-stocking : {{ product.metafields.custom.stock_eta %}
{% endif %}

Resolution:

  • The confusion stemmed from misunderstanding sections vs. blocks—the tutorial created a section, not a block
  • The existing “HTML” block in the theme accepted Liquid code directly
  • User successfully implemented the metafield display using the HTML block option

Alternative Suggested:
Manually adding custom liquid block support to theme files, though this requires code editing or hiring a developer.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

Hey,

so, on one of my stores, I have the “custom liquid” option in themes, which I used to pull data from a metafield into the product pages. Dead simple

Another of our stores, doesnt have the “custom liquid” as an option, so, I followed this simple tutorial, however, it doesnt work. I dont see the custom liquid option?

https://www.youtube.com/watch?v=VhKFTvFeeCg&t=249s

I want the custom liquid section, so I can add the following (dead simple)

{% if product.metafields.custom.stock_eta %}

Re-stocking : {{ product.metafields.custom.stock_eta }} {% endif %}

The youtube tutorial (reached from the shopify support page), says it will add it to “any” theme, however, it doesnt seem to have done that for mine.

Any ideas? The url is www.ivormairants.co.uk/

Cheers

1 Like

Actually, I have got that wrong, I can create it in sections, but, I want it as a block, in this section

Which I presume is another bit of code?

Hey @JJWatt

Some themes by default doesn’t supports the Custom Liquid section so you can just simply add it manually in your theme files by following This Tutorial

I would highly recommend you to duplicate your theme before making any code changes and if you’re not comfortable in coding the hiring a Shopify developer would be the best option for you.

Best Regards,

Moeed

Hey

I have managed to create the section, but, I cant insert it as a block, as the second post here. I “need” to put it where I want it, but, I cant seem to on this one somehow. I can only add a block, within that section to make it correct as far as appearance on the page. If that makes sense?

Thanks

As in, I want to put it here where circled

If you’re going to edit theme code anyway, you can simply add the metafield code you need where you need it.

Your theme seem to support Shopify 2.0, so should be compatible with the code from the tutorial.

It is possible that your theme has similar section already, it may just be called differently, like “Custom HTML”…

Share a screenshot of the code you’ve added in your theme editor – this may help to diagnose further.

Hey Tim

I wondered about that, when I go to add a block, these are the only options in the section I want it

The code that works on my other site in custom liquid is

{% if product.metafields.custom.stock_eta %}

Re-stocking : {{ product.metafields.custom.stock_eta }} {% endif %}

where it pulls the information from my stockfeed via Sync-X and a custom output from my side

Ah – the code is not for block, it’s a code for a Section.

The guy in video uses “section block” term, but actually creates a section.

If you want to have a “custom code” block in some particular section, you’d need to edit this section code.

This is how it looks in Dawn “product information” section:

https://github.com/Shopify/dawn/blob/release/15.2.0/sections/main-product.liquid#L945-L955 – definition in section schema.

https://github.com/Shopify/dawn/blob/release/15.2.0/sections/main-product.liquid#L210-L211 – rendering the block in section code.

What should be done in your theme – hard to tell exactly without seeing the theme code.

Actually – there is a “HTML” block – have you tried to use that one? High chances it will work.

1 Like

Ah, funny enough mate, the html one actually accepted the code straight up, so, thats done it. I didnt even look at it as it wasnt liquid, but it does say supports it, and it works :slightly_smiling_face: Nice one, thank you