Display Metafield Title with Value

Hello! I’m trying to display the Metafield Title along with the metafield value. For example, we have guitars that have different Body Materials. So we have a metafield with the title “Body Material,” but when we display the “Body Material” metafield dynamically, it only says “Mahogany” or “Spruce.” I’d like it instead to say “Body Material: Mahogany” or “Body Material: Spruce” if that makes sense. I know I could just type it in non-dynamically, but not everything has all the metafields filled out, and I’d like the title to not show if there is no value to display. Any ideas on how to achieve this? Thank you!

Hello @BootheMusic ,

You need to use the metafield with the if condition.

e.g.

{% if product.metafields.body-material != blank %}
Body Material: {{ product.metafields.body-material }}
{% endif %}

Thanks