Shopify themes, liquid, logos, and UX
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
Use this code for metafields
{% assign accordion_content = block.settings.content | strip_html %}
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
So the question would be how to prevent theme to automatically add " " to block.settings.content and where and when it actually happens?
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024