> For the complete documentation index, see [llms.txt](https://mpithemes.gitbook.io/unicorn-shopify-theme/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mpithemes.gitbook.io/unicorn-shopify-theme/faq/understanding-of-metaobjects-and-their-use-in-a-store.md).

# Understanding of metaobjects and their use in a store

This article provides several examples of how metaobjects can be practically used in the theme. Of course, you can implement this functionality into other parts of the theme according to your needs by following Shopify's recommendations. More about metaobjects can be read on the following [help page](https://help.shopify.com/en/manual/custom-data/metaobjects).

### How to display unique content per product

{% hint style="info" %}
If you need to separate a product or group of products for which the following content will be used, operate [<mark style="color:blue;">templates</mark>](https://mpithemes.gitbook.io/unicorn-shopify-theme/faq/how-to-create-a-template) as a new block should be added to a page that may be unnecessary for other product pages.
{% endhint %}

First, let's explore how to add new data for products that dynamically change based on a product. To complete this task in your store, follow these steps:

#### **Step 1**

{% hint style="info" %}
**Creating the metaobject!** This step is required to create a new metaobject definition with entries that allow you to add and store new data in your admin.
{% endhint %}

Go to your *Shopify admin -> Settings -> Metafields and metaobjects -> Metaobject definitions* and click on the **"Add definition"** button.

<figure><img src="/files/OsDhv9ckCqLsy78chmso" alt=""><figcaption></figcaption></figure>

Create a metaobject definition by adding its name and fields. In our example, we will add a definition with the name "Additional details" and three fields:

<figure><img src="/files/u0MRv0arxyCQdt11xPDB" alt=""><figcaption></figcaption></figure>

<mark style="color:orange;">**Note!**</mark> The "File" type field cannot be used as the display name of a metaobject entry that will be formed in the next step. For personal convenience, create an additional field specifically for this purpose if you need to display only an image on the storefront (without using text fields), for example:

**First field.** The first field will be formed to display an entry title. So, it will be set with the following parameters:

* Name - **Title**

- [x] **Use this field as display name** (Tick the option to use this field as the name of an entry)

* Single line text - **One value**

<figure><img src="/files/5EJ8LDEbYjjf5vnGp4o5" alt=""><figcaption></figcaption></figure>

**Second field.** The next field will be added to display text paragraphs:

* Name - **Text**
* **Single line text** - **One value**

<figure><img src="/files/xZBFA9rZbniSDCpnHFby" alt=""><figcaption></figcaption></figure>

**Third field.** Add a field with the following parameters to display an image:

* Name - **Image**
* **File** - **One file**
* **Accept specific file types - Images**

<figure><img src="/files/DQVzbBd85rqaWJzw7Xed" alt=""><figcaption></figcaption></figure>

**Step 2**

To add metaobject entries, go to *Shopify admin -> Content -> Metaobjects*, and click on the definition name.  Then, hit the **"Add entry"** button.

<figure><img src="/files/vIk9ZK7Klc9uGHP6PUDc" alt=""><figcaption></figcaption></figure>

Create as many entries as necessary by editing the provided fields, for example:

* Title - name the entry.
* Text - add the desired text line.
* Image - select image.

<figure><img src="/files/TWurELb5xjv5I4wJi5EV" alt=""><figcaption></figcaption></figure>

#### **Step 3**

{% hint style="info" %}
**Building a metafield!** This step is necessary to link new data with the corresponding product in your admin and display this information on the storefront.
{% endhint %}

Create a metafield definition by pressing the **"Add definition"** button in your *Shopify admin -> Settings -> Metafields and metaobjects -> Metafield definitions -> Products*. Read about the metafield definition [<mark style="color:blue;">here</mark>](https://help.shopify.com/en/manual/custom-data/metafields).

<figure><img src="/files/xu784hmOcl6pnkV7zBGv" alt=""><figcaption></figcaption></figure>

The example of the metafield definition can be viewed below:

* Name - **Item 1**
* Namespace and key - **custom.item\_1**
* Metaobject - **Additional details**
* **One entry**

<figure><img src="/files/evA4bf2AXn46BJzzYbe8" alt=""><figcaption></figcaption></figure>

If you need to display several metafields with different content per product, add additional metafield definitions. We created three metafields to display three content lines on a product page.

<figure><img src="/files/4Nj9HKz2S6ktoKS4ACQ7" alt=""><figcaption></figcaption></figure>

#### **Step 4**

Link metafields with products in your *Shopify admin -> Products*. Select a metaobject entry for each metafield to show several content lines on the storefront.

<figure><img src="/files/vA0K6MnfyzsDF3ThlFHR" alt=""><figcaption></figcaption></figure>

#### **Step 5**

In your *Shopify admin -> Online Store*, press the **"Customize"** button next to the desired theme. Then, go to *Products -> Product information* in the Theme Editor. In the provided section, hover over the space between blocks, hit the **"Add block"** button, and select the **"Icon with text"** block.

<figure><img src="/files/TnGmzAfruzfUVN8K8WXD" alt=""><figcaption></figcaption></figure>

Now you can link each metafield with the corresponding content:

<figure><img src="/files/Zjmip0IZw2E5Mh23Lfvs" alt=""><figcaption></figcaption></figure>

***

### How to build pages using metaobjects

{% embed url="<https://www.youtube.com/watch?v=WsG1rR5A17g>" %}

You can certainly use the traditional method of creating new pages using templates, as described on the following [<mark style="color:blue;">help page</mark>](https://mpithemes.gitbook.io/unicorn-shopify-theme/faq/how-to-create-a-template). However, if you need to build multiple pages of the same category across a store with identical sections and blocks but with unique content on each page, you want to do it quickly, efficiently, and in bulk, the Shopify functionality for setting metaobject templates can be extremely useful.

Metaobject templates can be used to create pages with information about vendors, artists, shop locations to identify sales spots where specific products are located, and more. In our example, we will create three pages featuring information about the artists whose work is showcased in the store.

Let's go through a step-by-step guide on how to use metaobject templates:

#### **Step 1**

First, add a metaobject. In your Shopify admin, go to *Settings -> Metafields and metaobjects -> Metaobject definitions* and press the **"Add definition"** button.

<figure><img src="/files/OsDhv9ckCqLsy78chmso" alt=""><figcaption></figcaption></figure>

Create a metaobject definition by adding its name and fields. Add as many fields as necessary to display the desired content on the storefront, such as text, images, links, etc.

This example demonstrates a definition with the name "Artist" and four fields:

<figure><img src="/files/XV3BlbLz6AHY2TZmsv2k" alt=""><figcaption></figcaption></figure>

**First field.** The first field will be formed to display an artist's name. So, it will be set with the following parameters:

* Name - **Artist name**

- [x] **Use this field as display name** (Tick the option to use this field as the name of an entry)

* **Single line text** - **One value**

**Second field.** The next field will be added to display a text paragraph with the main description of the artists:

* Name - **About artist**
* **Multi-line text**

**Third field.** Add a field with the following parameters to display an image:

* Name - **Image**
* **File** - **One file**
* **Accept specific file types - Images**

**Fourth field.** Select the "URL" type to create a field for the link:

* Name - **Link**
* **URL** - **One value**

#### **Step 2**

To store and organize content that will be displayed on the storefront, add metaobject entries. In the Shopify admin, navigate to *Content -> Metaobjects* and click on the definition name. Then, click the **"Add entry"** button.

<figure><img src="/files/7KjU27Y1TTIc8wkPmZmn" alt=""><figcaption></figcaption></figure>

Create as many entries as needed by editing the provided fields, such as:

* Artist name - artist's name.
* About artist - add some paragraphs.
* Image - add an image.
* Link

<figure><img src="/files/qrZvubxzAxL7RzkmEP7r" alt=""><figcaption></figcaption></figure>

We want to display three pages featuring artists, so we've added three entries, each corresponding to a different artist.

<figure><img src="/files/ZKOERHMZ07J6n7bU2I8g" alt=""><figcaption></figcaption></figure>

#### **Step 3**

1. Add a metaobject template in the Theme Editor using the top selector.

<figure><img src="/files/nrQ2r1by0fy8OvzOnpvw" alt=""><figcaption></figcaption></figure>

2. In the opened pop-up, specify the metaobject definition, such as "Artists".
3. Then, edit the provided fields with the corresponding information if necessary:

* Page title
* Meta description
* URL handle

<figure><img src="/files/fx249YJh0CPgv6n0MF44" alt=""><figcaption></figcaption></figure>

4. Next, click the **"Create template"** button.

#### **Step 4**

To navigate to the desired template, select it from the top drop-down menu.

<figure><img src="/files/ySC7YkaP84OouoinoqwM" alt=""><figcaption></figcaption></figure>

Now you can customize the page with the required content by selecting the appropriate section with blocks.

1. Press the **"Add section"** button in the **"Template"** and select a section. The "Media" section will be used as an example.

<figure><img src="/files/lfsC7PC9SRemhsz2YImt" alt=""><figcaption></figcaption></figure>

2. Specify content in the corresponding fields of the section by hitting the dynamic source icons.

<figure><img src="/files/703KuFwOrcDrJNpknzA8" alt=""><figcaption></figcaption></figure>

Repeat the same steps to assign content to all the fields, such as heading, description, image, link, and so on.

3. Press the **"Change"** button next to the page title to view other pages. Then, select another page.

<figure><img src="/files/GiqAlbwfcubhKKzSCovK" alt=""><figcaption></figcaption></figure>

***

### How to place content in sections using the metaobjects

Metaobjects are useful for adding the same content to dynamic sections across different parts of a store, helping you avoid the repetitive task of adding information to each block when using multiple blocks in a section.

Additionally, with metaobjects, you only need to edit the information in the entries once, and it will automatically update in the corresponding sections throughout the store.

Let's take a closer look at how it works.

#### Scenario 1:  Bulk adding content to a section

#### **Step 1 and Step 2**

You can use an existing metaobject or add a new one in your *Shopify admin -> Settings -> Metafields and metaobjects -> Metaobject definitions* by pressing the **"Add definition"** button. To create a new metaobject definition with entries, follow [<mark style="color:blue;">Step 1</mark>](#step-1-1) and [<mark style="color:blue;">Step 2</mark>](#step-2-1) above.

We will use the same metaobject created earlier to display information about artists.

#### **Step 3**

Now, create a metafield to connect metaobjects with theme sections. To handle this configuration, navigate to *Shopify admin -> Settings -> Metafields and metaobjects -> Metafield definitions.* Here, you can add metafields for any page category, such as Products, Collections, Pages, and so on. Select the page category where you want to display the content.

In our example, we want to represent all artists on a single page. So, we will build a Page metafield definition.

<figure><img src="/files/9mjKjamc6g5IOttELtfj" alt=""><figcaption></figcaption></figure>

Add a metafield definition by pressing the **"Add definition"** button. The example of the metafield definition can be viewed below:

* Name - **Artists**
* Namespace and key - **custom.artists**
* **Metaobject** - **Artist**
* **List of entries** (As we need to display several artists on a page, we use the "List of entries" option)

<figure><img src="/files/FiLCJnkS5DBATYiXgrk7" alt=""><figcaption></figcaption></figure>

#### **Step 4**

In this step, you can use a default page or create a new template and assign it to a page.

Variant 1: Create a new template

1. Add a new template in the Theme Editor by pressing the top drop-down menu and selecting the **"Pages"** category or any other relevant category. Then, press the **"Create template"** button.  For more details, refer to the following [<mark style="color:blue;">help page</mark>](https://mpithemes.gitbook.io/unicorn-shopify-theme/faq/how-to-create-a-template).

<figure><img src="/files/F6j9ovVzLDPwdezfcFyQ" alt=""><figcaption></figcaption></figure>

2. Create a new page or use the one you've already created. Navigate to *Shopify admin -> Online Store -> Pages* and add a new page. How to create pages can be read [<mark style="color:blue;">here</mark>](https://mpithemes.gitbook.io/unicorn-shopify-theme/faq/how-to-create-webpages).
3. Assign a template to the page.

Variant 2: Use the existing page. Select a page in *Shopify admin -> Online Store -> Pages*.

Then, follow the steps below regardless of the variant used above:

1. On the opened page, press the **"Show all"** button in the "Metafields".

<figure><img src="/files/TufyQYd7VcHaXiCyIA8s" alt=""><figcaption></figcaption></figure>

2. Assign all entries to a metafield.

<figure><img src="/files/TfzL6BrF26vdEDADdEcq" alt=""><figcaption></figcaption></figure>

Save the changes.

#### **Step 5**

Link the content with a section:

1. Go to the Theme Editor and select a corresponding page.
2. Then, add a section from the list. In our example, we will use the "Multicolumn" section with the "Column" block.
3. In the "Column" block, press the dynamic source icon to reference a metaobject.

<figure><img src="/files/KS5UICpdHrYDYMZAELUO" alt=""><figcaption></figcaption></figure>

&#x20;All the metaobject entries should be added at once.

<mark style="color:orange;">**Note!**</mark> Shopify needs some time to update the information or several refreshes.

<figure><img src="/files/5kBaVmZatdyymkuMfXOq" alt=""><figcaption></figcaption></figure>

#### Scenario 2:  Display unique information on a specific page of the same category

Another scenario is when you need to place unique content per page. For instance, you may want to feature information about artists, vendors, or store locations on pages within the same category, with content that dynamically changes based on the relevant page. This can also be accomplished using metaobjects.

This example demonstrates how to showcase artists on collection pages where their products are featured. For this, we utilize the same metaobject that was used before.

#### Step 1 and Step 2

We'll skip [<mark style="color:blue;">Step 1</mark>](#step-1-1) and [<mark style="color:blue;">Step 2</mark>](#step-2-1) since you can refer to the above to learn how to build a metaobject. Instead, we'll move on to the next step: creating a metafield.

#### Step 3

Since the goal is to display artists on specific collection pages, we'll create a metafield associated with the collections. To do this, go to *Shopify admin -> Settings -> Metafields and metaobjects -> Metafield definitions*, and select **"Collections"**. If you need to display content on another page category, create a metafield for the corresponding page by selecting it in the list. Then, follow the guidance described below.

Press the **"Add definition"** button. The example of the metafield definition can be viewed below:

* Name - Artist
* Namespace and key - **custom.artist**
* **Metaobject** - **Artists**
* **One entry** (As the only artist will be linked to a metafield on the specific collection page)

Save the settings.

#### Step 4

Link a metafield with a page, such as collections, by going to the *Shopify admin -> Products -> Collections*. In this step, you can assign the exact content you need to showcase on a specific collection using the metaobject entries.

<figure><img src="/files/rv9P13aUSXNCaAJxFLEL" alt=""><figcaption></figcaption></figure>

#### Step 5

Once you have completed all the necessary settings in the admin, proceed to the Theme Editor and associate the content with a section. In the Theme Editor, select a page (for example, **"Collections"**) and add a section. Then, connect content by pressing the dynamic source icon next to each field.

In this example, we used the "Media" section.

<figure><img src="/files/4lPU5cQYjF9dYgT9QWqb" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mpithemes.gitbook.io/unicorn-shopify-theme/faq/understanding-of-metaobjects-and-their-use-in-a-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
