How to Display a List of Items on a Shopify Page Using Metaobjects

Last update:
June 13, 2023

Knowledge Requirements:

  • Shopify Liquid
  • HTML5
  • CSS

If your project’s business is reselling artworks of different artists or maybe products from different brands, having a page where you can display them would help your visitors or potential customers find them easily and would make it a better experience for them.

In the case of brands, you have an option to just use the ‘vendors’ field on the product listing. You can just iterate the products on the page and access the ‘vendor’ property. However, if you want an image/logo of that brand to be displayed as well, you’ll have to store these images on a file and manually update them in the future whenever there is a new brand added to your store. 

I used to do this and I can’t say it was too hard, but I always wished there was a place where I could just store each brand’s logo and name more efficiently. 

Thankfully, Shopify recently launched a new feature that was designed specifically for this, the Metaobjects. 

In this tutorial, I will show you how you can display a list of any kind of items you want on a Shopify page. 

Note:

In this tutorial we are trying to display a list of brands. 

Setting Up a Metaobject 

2 Ways to Get to the Metaobjects Page:

  1. Left side panel > Content > Metaobjects 
  2. Settings > Custom data > Metaobjects

So, before you can use or assign a Metaobject, you first need to create it and define what it is and what it is about. You need to build the necessary fields for it. If you are completely new to this feature, you may follow the steps here

After this, add maybe 3-5 brands (logos and brand names) that you want to display on the page.

Creating the Page Where the List will be Displayed

1. On the left panel on Shopify, click ‘Online Store. Then on Themes, click the ‘three dots’ icon and select ‘Edit code.’

2. Next, on the left panel, look for the ‘Templates’ folder and click ‘Add a new template’. You can just select liquid and put brands as the file name. Save it.

Adding a new page template on Shopify

3. Go back to Shopify’s admin page.

4. On the left panel on Shopify, click ‘Online Store.’ Then click pages and click ‘Add page.’

5. Next add the page’s name and change the template on the bottom right part to the template you’ve just created. 

Assigning a page template on Shopify

6. Save it. 

Displaying the List to the Page

1. Open the code editor and go to the template you’ve created for the page.

2. Iterate the entries you’ve created for this Metaobject. To do this, you will need to use ‘shop.metaobjects’ then add the assigned type. So that will be ‘shop.metaobjects.brands.values’ just like what shows on the screenshot below.

Iterating metaobject entries on Shopify

3. Use the variable you used in the iteration to access each value. 

4. Save it. 

And there you go, you should now see all of the entries you’ve added on your Artists Metaobject.

Note: 

If you have a lot of items to display, it would be great to have a search bar to help your visitors find what they are looking for faster. Follow my tutorial on: How to Add a Page Search Bar on Shopify.

Red Dela Cruz | Shopify and Webflow developer

Red Dela Cruz

An enthusiastic Shopify and Webflow developer just like you!

I’ve learned a lot of things in web development by reading and watching tutorials. So, now, I want to pay it forward. 🤓