Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I have a Color metafield:
- Single Line
- Value List
Where I want to put the product colors in.
Sometimes only one, sometimes 5 colors per product.
Now I want to display the color(s) to the customer in a single line seperated by a "/".
This is the output if you render the metafield like :
{{ product.metafields.custom.color.value }}
Both tags have no space in-between
And this is the output if I´m trying to use the "Split" function:
{{ product.metafields.custom.color.value | Split:"/" }}
Why does it render the "(" brackets?
This is how the metafield is set up
The Code that renders the Color Variant:
<p class="related-products-heading" style="font-size: {{block.settings.heading_font_size}}px; color: {{block.settings.heading_color}};">{{ block.settings.heading }}
<span style="color: #acacac;">Farbe: </span> <span style="color: #4DA9A9;"> {{ product.metafields.custom.color.value }}</span>
</p>
Any ideas how to solve my issue?
Of course you can do something like this:
{{ product.metafields.custom.color.value | remove: "[" | remove: "]" | remove: '"' | split: "/" }}
But at the end the "/" still does not work and will only render a ",":
Bump!
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025