Set up compatible field in metafield

Hello

In my theme, when I try to set up metafield for the “Product tab”, this metafield only compatible with the “Single Line Text”

But I want to put the “rich text” for this field, how can I make “rich text” compatible in this field?
Please help, thank you very much

Hey @jsngn , would you like to share the store URL. So, I can look further into your request.

Regards,
Osama Farooqi

Here is the compatibility info: https://shopify.dev/docs/storefronts/themes/architecture/settings/dynamic-sources#metafields

Looks like your section setting in section schema for this input is “text” while you need it to be “richtext” to be compatible with this type of metafields.

May also need to modify the liquid code of the section (may strip html code from setting value?), hard to tell without seeing it.

1 Like

Hi @osamafarooqi71 ,

thank you

my URL is https://b34545-1e.myshopify.com/products/anderson-u-messenger-bag

do you know what file I need to find tomodify the liquid code?

Thanks!

my guess would be sections/product-template.liquid, but hard to tell from outside.

1 Like

is this one?

You need to look inside {% schema %} … {% endschema %}

Find where these accordion tabs are defined.

Though now I start to believe that instead of selecting metafield as dynamic source you’d need to enter this metafields “path” in this input field…

need to see the code.

How can I show or send you the code

try https://pastebin.ai/ and share a link

1 Like

great. thanks

here is the link

https://pastebin .com/HbEXwtKZ

{%- when 'product_tab' -%}
  {% include 'accordion_information' %}

so the actual code is in a snippets/accordion_information.liquid – would need that one too…

Here it is :grinning_face_with_smiling_eyes:

https://pastebin. com/DxenBdKu

I would like to add “rich text” for the metafield in this field

Yes.

You need to go to your sections/product-template.liquid and modify this part of the code inside {% schema %} … {% endschema %}, starts at line 1488:

{
	"type": "text",
	"id": "tab_metafields",
	"label": "Tab metafields.Use only when selecting the metafields tab"
}

Replace “text” with “richtext”.

It there is a complaint about incompatibility, try “inline_richtext”

1 Like

hi @jsngn

Have you tried the solution provided by @tim_1 ? Did it solve your issue?

1 Like

yeah I just try it. It works now!

Thanks both of you!!

thanks a lot! It work perfectly