How to make a metafield with a list of Collection work as a dynamic objects?

Topic summary

Goal: Display a list of Collections stored in metafields/metaobjects as dynamic content in the Dawn theme.

Key approach (metafield on Collection):

  • Create a Collection metafield (type: List of Collections), e.g., namespace: custom, key: creators.
  • Populate it in Admin > Products > Collections.
  • In theme code (e.g., snippets/card-collection.liquid), access and loop:
    • Use card_collection.metafields.custom.creators.value to get the list.
    • Iterate and render each collection (e.g., col.title).

Metaobject case (list of Collections inside a metaobject):

  • Access the metafield’s .value to get referenced metaobjects, then nested loop:
    • For each metaobject, read its collections field via obj.collections.value.
    • Iterate lCollections and render properties like col.title.

Limits/clarifications:

  • Collection filters (applied filters) are not accessible via col.filters in these contexts.
  • Filters are driven by URL parameters and only available within collection or search templates (e.g., main-collection), not from metafields/metaobjects in other templates.

Status: Solution provided via Liquid code loops using .value; dynamic source binding in the editor supports single references, but lists require code. No further actions indicated.

Summarized with AI on December 22. AI used: gpt-5.

I have made a metaobject for our “creators”, with a metafield consisting of a list of “collections”.

How do I display that list of collections in my Theme as dynamic content?
I am testing it out in the “Dawn theme”, and using the section “list collections”, but can only seam to connect it to metafields with a single collection and not a list.

Anybody have an answer or can point me in the right direction?

Hi @mns-burg ,

Which object ( product, collection .. .) did you create this metafield?

You can refer code below. I created for collection

  1. Create metafield for collection object

  2. Go to Settings → custom data → Collection

  1. Create a metafield Namespace: custom. Key: creators

  1. Go to Admin → Products → collections → select collection → add data for collection

  1. Go to Store Online-> theme → edit code → snippets/card-collection.liquid

  2. Add code below to top of file to test.

{%  if card_collection.metafields.custom.creators.value != blank %}
  {%  assign lCollections  =  card_collection.metafields.custom.creators.value %}
  
  {%  for col in lCollections  %}
    - {{ col.title }}
  {% endfor %}
    

{%  endif %}

How would you go around displaying that if the field’s where in a metaobject?
So a metaobject with a list of collections attached to it.

Hi,

Try to access all data with {{ product.metafields.namespace.value }} and then iterate through that

{% for metaobject in product.metafields.namespace.value %}
{{ metaobject.field }}
{{ metaobject.field.value }}
{% endfor %}

Maybe it is not clear with those abstract names so here is a small example.

Let’s say there is a meta object collections . To get those we iterate like

{%  if card_collection.metafields.custom.creators.value != blank %}
  {%  assign metafObjects  =  card_collection.metafields.custom.creators.value %}
  
  {%  for obj in metafObjects  %}
    {%  assign lCollections  =  obj.collections.value %}
    
    {%  for col in lCollections  %}
      
    - {{ col.title }}
    
      {% endfor %}
   
   
  {% endfor %}
    
{%  endif %}

1 Like

I got a question about your example : are the collection filters available through the second loop ? How can I access to them ?

{%  assign metafObjects  =  card_collection.metafields.custom.creators.value %}
{%  for obj in metafObjects  %}
    {%  assign lCollections  =  obj.collections.value %}
    {%  for col in lCollections  %}
        {{ col.filters}}       <- This value should contains collection filter in the main-collection template but is empty through a metafield or a metaobject in any other template
    {% endfor %}
{% endfor %}

Hi @Daouda_of_Mist ,

It’s impossible. Because Applied filters are reflected through URL parameters. When you can’t use anywhere outside collection template/search template.

You can refer document here https://shopify.dev/docs/storefronts/themes/navigation-search/filtering/storefront-filtering/support-storefront-filtering#the-filter-display