How can I display a dynamic collection list on a custom page using metafields?

Hi,

I am using the Dawn theme and I have some custom page templates to show different sub collections within a main collection trough a collection-list.

So for example I have a main collection ‘clothes’ and sub collections ‘shirt’, ‘hat’, ‘pants’,…

Then I have a custom page template to show all the different sub collections trough a collection list and some more info beneath that.

I now want to make this collection list dynamic by using a metafield. I have made a new metafield in pages called ‘subcollections’ and have it assigned a collection list. Now when I go in the clothes page, I can select which are the subcollections in this metafield. So far all good.

Now I want to dynamically connect the collection list to the page metafield so that it shows all the subcollections available in the metafield for this page. For some reason this is not working as I thought..

I did the same in the collection pages. I have some ‘main’ collections that have subcollections I want to show when on the collection page. Here this works in the way described above to make the collection list dynamical.

Does any one know what I could have done wrong or if there is a beter way to do this?

In short, I want to add a collection-list to a custom page template that is dynamical trough a metafield connected to this particular page. So when I need to change something in the collection-list, I can just edit the according metafield.

Hope this was clear and makes sense. All advice is welcome!

1 Like

Did you ever figure this out? I did the same thing and ran into the same wall you did it sounds like.

Collection list Section doesn’t have the capability to dynamically connect a collection list metafield, but it’s blocks can do that, but in order to do that the number of collections in Collection LIst Section can only be static. Basically you can connect e collection metafield to a collection block but not a collection list metafield to the collection list section.

Hey, @BelgiumBaitShop

You can leverage Shopify apps like Metafields Editor to streamline the process of managing metafields and connecting them to your custom page template. These types of apps provide a user-friendly interface for creating and editing metafields, allowing you to associate specific data with your pages efficiently.

For example, after creating a metafield named ‘subcollections’ and assigning a collection list to it within your pages, you can proceed to link this metafield to your custom page template. To connect the collection list to the page metafield, you may need to customize the Liquid code in your template to fetch and display the subcollections associated with the metafield.

By modifying the Liquid code in your custom page template, you can retrieve the values stored in the ‘subcollections’ metafield and render them as a dynamic collection list on the page.

If you aren’t sure about coding, I recommend hiring a Shopify expert who would be able to accomplish this at a reasonable price.

Another app, of course… Typical Shopify :disappointed_face:

1 Like