jsngn
June 16, 2024, 4:10am
1
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
tim_1
June 16, 2024, 1:39pm
3
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
jsngn
June 16, 2024, 3:17pm
4
jsngn
June 16, 2024, 3:19pm
5
do you know what file I need to find tomodify the liquid code?
Thanks!
tim_1
June 16, 2024, 3:24pm
6
my guess would be sections/product-template.liquid, but hard to tell from outside.
1 Like
tim_1
June 16, 2024, 3:51pm
8
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.
jsngn
June 16, 2024, 3:56pm
9
How can I show or send you the code
tim_1
June 16, 2024, 4:11pm
10
try https://pastebin.ai/ and share a link
1 Like
jsngn
June 16, 2024, 4:56pm
11
great. thanks
here is the link
https://pastebin .com/HbEXwtKZ
tim_1
June 16, 2024, 5:39pm
12
{%- when 'product_tab' -%}
{% include 'accordion_information' %}
so the actual code is in a snippets/accordion_information.liquid – would need that one too…
jsngn
June 17, 2024, 1:39am
13
Here it is
https://pastebin . com/DxenBdKu
jsngn
June 17, 2024, 1:41am
14
I would like to add “rich text” for the metafield in this field
tim_1
June 17, 2024, 3:29am
15
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
jsngn
June 17, 2024, 11:15am
17
yeah I just try it. It works now!
Thanks both of you!!
jsngn
June 17, 2024, 11:15am
18
thanks a lot! It work perfectly