Hi on my theme metafield is not visible on frontend
https://8b047a-60.myshopify.com/
gaisao
Is anybody help me?
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
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" }} |