Shopify themes, liquid, logos, and UX
Hi,
Hoping someone can help. I'm trying to add collapsable tabs to my product pages and using metafields to pull in the required information. Within the product description tab I'd like to have a bulleted list. I've added a metafield list but when I'm adding the values they're displaying as:
blah, blah and blah
But I would prefer:
Can anyone help? I assume I need to edit the code
Thanks
Hi @Laurasnow
I would like to give you some suggestions below:
- You can try to add the following code where you want to show the metafield.
{%- if product.metafields.custom.metafield_multi_line != blank -%}
<ul>
{% for metafield_value in product.metafields.custom.metafield_multi_line.value %}
<li>{{ metafield_value }}</li>
{% endfor %}
</ul>
{%- endif -%}
- For example, for the Dawn theme, if you want to show the metafield on the product description page, you will add the above code to the main-product.liquid file.
Please let me know if it works for you.
If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here ☕.
B2B Solution & Custom Pricing | Product Labels by BSS
Need help from our expert? Kindly share your request with us via community@bsscommerce.com
Hello @Laurasnow ,
I would like to give you some recommendations to support you. Let's try using this code and add it to metafield:
<ul>
<li>Blah</li>
<li>Blah</li>
<li>Blah</li>
</ul>
If you require any further information, feel free to contact me.
Best regards,
GemPages Support Team
It doesn't look like metafields support HTML like that. I tried this and it just displays the HTML.
You need to use rich list rather than Multi line as this supports a lot of formating
Thank you! Yes I found out last week that there is a Rich Text content type for metafield.
This is working if typing manually the fields <ul> and <li> directly in the rich text field. But if I copy and paste the code from Excel, the html code automatically disappears, it's not shown in the rich text field and the bulletpoints are not working.
Since I have a lot of products, I have to use the import (Matrixify) and it does not work..
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024