Issue with Metafields that are reference to pages and accept lists

Hi All,

I have an issue with Metafields and I can’t find a solution.

Let me explain the problem and I hope you can guide me to solve it.

  • I want to show a list of pages in a Product page. These pages are links to dictionary terms and the pages are built in Shopify

Something like this (I designed it to show what it could looks like)

  • The way I am doing it, is by creating a metafield
  • The metafiled is a “Reference” type, and I reference ‘pages’
  • I also selected “accept a list”
  • The namespace and key are: my_fields.dictionary_term

  • Until here, all is good, but this is when the issue arises.
  • When I try to add a custom block to the product page, I cannot find a way to show the list of pages
  • This is what I am doing, but it doesn’t work
{% for related_page in product.metafields.my_fields.dictionary_term.value %} 

<a href="{{ related_page.url }}">{{ related_page.title }} </a></br>

{% endfor %}

Copy

  • Now, keep in mind that if I have a Reference Metafields where I have a list of Products. instead of pages, then this code works perfectly, so not sure why it doesn’t work for pages
{% for related_product in product.metafields.my_fields.related_products.value %} <a href="{{ related_product.url }}">{{ related_product.title }} </a></br>{% endfor %}

Copy

Do you know if/how can this be solved?

Thanks so much for your time, really super appreciated

Max