Prestige v.7 use HTML in metafields and then in Collapsible text section

piotrek83
Shopify Partner
16 0 0

Hi, 

 

As described above in title I would like to use HTML markup in my metafield and then source it to collapsible text section.  The problem is it always appear in paragraph tags <p></p> or/and with quotation marks which override all markup applied in metafield itself. The reason (probably) is the fact that theme assigns accordion_content value to block.settings.page.content | default: block.settings.content (line 78 of main-product.liquid prestige 7.3 : assign accordion_content = block.settings.page.content | default: block.settings.content) The problem is that I would like to make many "tabs" and more then one association co I cannot hardcode association to particular metafield directly ie. {{ product.metafields.my_fields.tab_1_content }}. I was trying to make it using {%- if -%} statement as well if accordion_title = "something" then assign particular metafield, but it didn't work (maybe due to my programing knowledge).

 

Maybe somebody could help me with that? 

 

PS. I dont want to install third party apps (like metafields guru) etc so please do not offer me such solutions in this correspondence. 

 

Thanks

 

Piotr 

Replies 3 (3)

NomtechSolution
Astronaut
1245 113 148

Use this code for metafields

{% assign accordion_content = block.settings.content | strip_html %}
piotrek83
Shopify Partner
16 0 0

Hi, 

 

Thanks fot the reply. 

It got rid of <p> </p>tags but it still adds quotation marks which override html. 

Any ideas for that? 

Btw, I also discovered that changes should be applied as well in product-info.liquid

 

Piotr

piotrek83
Shopify Partner
16 0 0

So the question would be how to prevent theme to automatically add " " to block.settings.content and where and when it actually happens?