How can I display bulletpoints in a Metafields list on product pages?

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:

  • blah
  • blah
  • blah

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 -%}
                  
                  {% for metafield_value in product.metafields.custom.metafield_multi_line.value  %}
                    - {{ metafield_value }}
                  {% endfor %}
                  

                {%- 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.

Hello @Laurasnow ,

I would like to give you some recommendations to support you. Let’s try using this code and add it to metafield:


 - Blah

 - Blah

 - Blah

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

    and
  • 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..