Hi on my theme metafield is not visible on frontend
https://8b047a-60.myshopify.com/
gaisao
Is anybody help me?
Metafield content on a product page wasn’t appearing; the user tried adding Liquid directly and searched for dynamic sources in the wrong place within the theme customizer. Clarification: dynamic sources must be attached inside a section or block, and custom metafields are accessed via product.metafields.custom..
Seeing “CollectionDrop” indicated the metafield stores a collection metaobject (an object type representing a collection), not plain text. To render values, the guidance was to use .value and then the metaobject’s properties (e.g., .title, .url). Arrays would require a Liquid for loop.
Final resolution: the user implemented Liquid that assigns test_metafield = product.metafields.custom.test.value and, if title and url exist, outputs a linked collection title; otherwise shows N/A. They also used a default filter for product.metafields.next_cart.occasion.
Outcome: issue resolved with working code; no remaining disputes. Key takeaway: use the correct metafield namespace, retrieve .value for metaobjects, and print specific properties (title/url) rather than the raw object.
Hi on my theme metafield is not visible on frontend
https://8b047a-60.myshopify.com/
gaisao
Is anybody help me?
Hi,
The metafield data field can be used in the theme customizer, if it doesn’t nest metaobject.
You can click “dynamic data source” to use a metafield value.
Yeah I need dynamic metafield its all visible on backend even I’m adding values to every product but on product page its not showing
On the screenshot above, you are searching metafiels in the blocks. It’s wrong.
You should search your metafieds after you will click on the “dynamic source” button, INSIDE a section or block
Read thought the guide for detailed how to https://shopify.dev/docs/themes/architecture/settings/dynamic-sources#example
Hi Serj94
Thanks for your reply I just checked articles but I dont have rich text or dynamic option
I’m adding metafield on my product page here is the code
| Test | {{ product.metafields.test }} |
|---|---|
| Occasion | {{ product.metafields.next_cart.occasion }} |
But the proble is its not showing the category in front of test I have assign from backend.
Screen shot attached
To access a custom metafield name, you should use: product.metafields.custom.test
Similar issue: https://community.shopify.com/post/2226301
Hi Serj94
After adding product.metafields.custom.test I’m getting this instead of collection
I want to add collection with link infront of test
Try also to add .value in the end to get a value from a metaobject.
To extract values from an array, such as your [“ssss”], use liquid for loop
CollectionDrop, because there should be more properties on the metafield.
For example: product.metafields.custom.test.value.collection_text.value
.collection_text. was as example ![]()
To see your real metafield properties, go to the admin, settings, custom data, select you metafield.
Return to the liquid code product.metafields.custom.test
Add .value.url
Example:
{% assign mycollection = product.metafields[“details”][“mycollectionfield”].value %}
{% comment %}
{{ mycollection.title }} - returns collection title
{{ mycollection.url }} - returns collection URL
{% endcomment %}
Thank you soo much
I used this
| Test | {% assign test_metafield = product.metafields.custom.test.value %} {% if test_metafield and test_metafield.title and test_metafield.url %} {{ test_metafield.title }} {% else %} N/A {% endif %} |
|---|---|
| Occasion | {{ product.metafields.next_cart.occasion | default: "N/A" }} |