Metafields not showing in product dynamic content fields

Metafields not showing in product dynamic content fields

Via_Verde_Wines
Tourist
4 0 1

I'm really struggling with metafields. I've set up all of my products, metafields and content in the product section of my Shopify admin. 2 of those metafields are description and tasting notes, and I want those to appear as text on each product page, dynamically populated by whatever is in those fields in the admin section under that product. When I set up a text block and click on the dynamic content icon (3 discs), some of the metafields (namely the two mentioned above that I want to have as text on the product page) aren't there in the dropdown as an option to select. I'm wondering if I haven't set them up properly? I have tried deleting them and reentering them, and checking their set up vs the ones that are showing, but I can't seem to see anything wrong. Can anyone help?

Screenshot 2024-04-09 at 16.00.31.pngScreenshot 2024-04-09 at 15.39.20.png

 

 

Screenshot 2024-04-09 at 15.39.20.pngScreenshot 2024-04-09 at 15.39.13.png

 

 

Replies 5 (5)
Via_Verde_Wines
Tourist
4 0 1

Hi Kaiya, 

 

Thanks for your help on this! I've attached a screenshot of all of the metafields I have set up (there are two descriptions metafields because I played around with different configurations, but neither are showing). the second attachment is the description metafield in case there is something wrong within the actual metafield. 

 

screencapture-admin-shopify-store-9a0904-3-settings-custom-data-product-metafields-58125746504-2024-04-09-17_07_37.pngscreencapture-admin-shopify-store-9a0904-3-settings-custom-data-product-metafields-2024-04-09-17_08_15.png

Via_Verde_Wines
Tourist
4 0 1

I think I’ve sorted it now, thanks so much for your help!

MaxDesign
Shopify Partner
213 15 85

I have not checked for myself but my best guess is that your metafield "custom.description" is of type "multi_line_text_field" (aka multi-line text) which might not be compatible with your current theme editor text setting which is of type "inline_richtext" (meaning, no line break or pararaphed allowed, thus not compatible with multi-line text).

Try to, either:

 

  1. Best: Modify the schema settings of the section. The setting could be of type "richtext" or "textarea" instead of "inline_richtext", and therefore could support the metafield of type "multi_line_text_field" that you have set up. Here is the doc. for the currently supported schema settings: https://shopify.dev/docs/themes/architecture/settings/input-settings#richtext
  2. Probably not what you want: Delete the metafield and recreate it with type "single_line_text_field", which will be eligible to your current section setting of type "inline_richtext"
Reach out to me at [email protected]
Via_Verde_Wines
Tourist
4 0 1

I changed it to single line text and it’s working for what I need, thank you so much for your help! I also need to include a specifications table lower down on the page, ideally dynamically populated from the other 9 metafields I have set up. The only way I can figure out how to do this is to add a page on each of the product pages, and setting up a table manually in the product description box with all of the content in, so each product page shows a different table. Do you know of a better way I could do it?

MaxDesign
Shopify Partner
213 15 85

For the table, adding page metafields for each product can work, and customize the tables in the page description box, yes. Depending on your data, you may be able to combine metaobjects and tablerow object, may be best for maintanability and better code structure, it really depends on your use case, you'd have to dig into those, and it could take a few trial and errors if you're only getting started with liquid.

Cheers

Reach out to me at [email protected]