Photo as Metafield in Collapsible Row

Hi! I want to insert an image into a collapsible row on my Product template as a place to put my size chart on each product. I read online that there may need to be some custom code put in to do this. Does anyone have some short code fixes to do this? Currently, there is a page metafield linked to different pages with pictures of the size chart, but I dont need all of the extra pages on my site.

Website: creativeblueprintbrand.com

What you have now is probably the simplest and cleanest solution.

It’s possible to use “Custom liquid” block with some code in it to fetch and render image from metafield, but I do not have it handy right now.

If you’re worried about SEO for these extra pages you can add a seo.hidden metafields to them like below.
Setting it to 1 will hide the page from search engines, sitemaps and site search.


When I follow those steps, an image doesn’t seem to be an option. And the metafield at the option below also doesnt show up.

where would I add it on the page? I cannot find a place to put this hidden metafield in the page manager

Of course – not all metafields are compatible with this setting.
That setting is for textual content and image type MF is not shown.

To create a MF for pages go to Settings-> Metafields and metaobjects-> Pages and add a MF there.
It will appear on the page page in admin then. (unintended pun : )

Documentation on this MF – https://help.shopify.com/en/manual/promoting-marketing/seo/hide-a-page-from-search-engines#custom-metafield

Hi @creativebp8 ,
Yes you can do this without creating extra pages by using a file/image metafield and a small theme edit.

  1. Create a product metafield
  • Admin → Settings → Custom data → Products
  • Type: File (or Image)
  • Name it something like Size chart image
  1. Upload the size chart image per product using that metafield.
  2. Add this code inside your collapsible/accordion row
{% if product.metafields.custom.size_chart_image %}
  <img
    src="{{ product.metafields.custom.size_chart_image | file_url }}"
    alt="Size chart"
    style="max-width:100%; height:auto;"
  >
{% endif %}