Metafields

Check Metafield Before Output

Avoids empty wrappers when a metafield has no value.

Copy or embed this snippet

{% if product.metafields.custom.size_chart != blank %}
  <div class="size-chart">
    {{ product.metafields.custom.size_chart | metafield_tag }}
  </div>
{% endif %}

Embed this snippet on your blog or docs — attribution link appreciated: HTMLToLiquid Converter · Convert to Shopify section →

Generate Shopify sections

Free AI-powered converter — OS 2.0 compatible output with schema validation.

Start converting HTML