# How to build Metaobjects

{% embed url="<https://www.youtube.com/watch?v=KRWZfF-CtF8&list=PLj-506KaR_vcQjwcpC6yII-1JY0bSj7df&index=33>" %}

{% hint style="info" %}
The same metaobjects can be used across multiple pages, allowing you to edit the information just once in your admin and automatically update it in all sections where the metaobjects are used throughout a store.
{% endhint %}

&#x20;Read more information about Metaobjects in the following [<mark style="color:blue;">**documentation**</mark>](https://help.shopify.com/en/manual/custom-data/metaobjects).

&#x20;To organize and display the additional structured information in your store, follow the next main steps:

#### Step 1. **Build a Metaobject**.

&#x20;To create and store additional information in your store, build a Metaobject definition with the list of entries. Each entry will include as many fields as you form while adding the Metaobject definition. The entries can be used to display in different theme sections and blocks.

* **Add Metaobject definition**. Go to *Shopify Admin -> Settings -> Metafields and metaobjects -> Metaobject definitions* and press the **“Add definition”** button:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2FEieVaGDrQZ37nNXRmRTD%2Fmetaobjects_create.png?alt=media&#x26;token=c2154fed-f766-455f-acda-cff4b7b27931" alt=""><figcaption></figcaption></figure>

&#x20;Then, type the name of the metaobject definition and change the **“Type”** if needed:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2FUqPbrOebPjJDXbrELAN1%2Fmetaobjects_additional%20features.png?alt=media&#x26;token=6ec1fa30-1e19-4bab-b159-165a3325ced8" alt="" width="563"><figcaption></figcaption></figure>

&#x20;In the **“Fields”** drop-down, choose the type of field:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2FNZLWBniozpVXxWo4uiwl%2Fmetaobjects_add%20field.png?alt=media&#x26;token=d71e4b44-af85-40a0-a1fc-fd80e4e27ab0" alt="" width="375"><figcaption></figcaption></figure>

&#x20;Edit the pop-up to create a new field:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2F9uNb6dftucVgsPpLywIH%2Fmetaobject%20field_text.png?alt=media&#x26;token=e2e6f02b-c897-4a70-befb-1040e51b9714" alt=""><figcaption></figcaption></figure>

&#x20;Add as many fields as needed:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2FbELq4Ot2P9rpLQ5OhcpJ%2Fmetaobject%20fields.png?alt=media&#x26;token=6ecf4096-c89a-4f43-9bbd-6d93fb2f2c9d" alt=""><figcaption></figcaption></figure>

&#x20;Hit the **“Save”** button to store settings.

* **Operate Metaobject entries**. To edit fields, you are going to create metaobject entries.

&#x20;Navigate to *Content -> Metaobjects* in your Shopify admin. Then select the metaobject definition and press the **“Add entry”** button. Next, choose the Metaobject definition in the drop-down for which the entry will be used:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2FoBWGKEqcj1wGWk4dXdgK%2Fmetaobject%20entry.png?alt=media&#x26;token=2c80fb2e-2a70-4ad5-be68-df7c9928c57e" alt=""><figcaption></figcaption></figure>

&#x20;Then, edit the fields with the content. And save the changes.

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2FIwu1EPfMZ2g9z6pWYwvn%2Fmetaobject%20entry_add.png?alt=media&#x26;token=431f8061-43ea-4c43-9eab-04bdaf599c5c" alt=""><figcaption></figcaption></figure>

&#x20;In case you need to use custom icons, you can find the list of icons [<mark style="color:blue;">**here**</mark>](https://shella-demo.myshopify.com/pages/icons).

&#x20;Add as many entries as you need:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2F0yCPfzD8eaTUUzQb17OS%2Fmetaobject%20entries.png?alt=media&#x26;token=3f60bff9-44c3-42a1-8863-f6d589a91328" alt=""><figcaption></figcaption></figure>

#### Step 2. **Create a Metafield**.

&#x20;Create a Metafield definition to connect Metaobject entries with a product. Thus, you will be able to assign each entry to a Metafield in the desired sequence and for each product.

* **Add a Metafafield definition**. Go to *Shopify Admin -> Settings -> Metafields and metaobjects -> Metafield definitions* and choose the part of the store to create metafield definitions. In our case, it will be **“Products”**.

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2F1Tpm5SoesVaIhSNAz2mp%2Fmetafields_create.png?alt=media&#x26;token=6a76c2ac-594f-409f-8a16-9296bcea8d66" alt=""><figcaption></figcaption></figure>

&#x20;Then, press the **“Add definition”** button:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2F81u8G3tvzg5buLN9vhaC%2Fmetafield_add%20definition.png?alt=media&#x26;token=f88a6c8a-818c-4ea7-a0a8-f94d199524dc" alt=""><figcaption></figcaption></figure>

&#x20;Create a metafield with the format:

* Name = e.g. **Feature 1**
* Namespace and key = **custom.feature\_1**
* Description = Your text (optional)
* Select content type -> **Metaobject**
* Reference = your **Metaobject definition**

&#x20;Save the changes.

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2FMFmXeQqJtXRbCW7IiB2J%2Fmetafield_feature.png?alt=media&#x26;token=7fc62a23-d709-4673-9e6d-f004ff2ca88f" alt="" width="563"><figcaption></figcaption></figure>

&#x20;Add numerous metafields:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2F4rt4uWg1lp6b2rJbaYse%2Fmetafield_definitions.png?alt=media&#x26;token=ba45fddb-4162-48cb-a64d-0494a5729f70" alt=""><figcaption></figcaption></figure>

* **Connect Metafields with the entries for a product**. Navigate to Products and select a product.

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2FoRc2YVm7ZScnILmYuVBH%2Fmetafield_entry.png?alt=media&#x26;token=91e43aef-a8d6-44c4-b062-8f6cb36efcab" alt=""><figcaption></figcaption></figure>

&#x20;Use each Metafield to connect with different entries:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2F92SSJIC6bMnJTnE6aC2F%2Fmetafields_entries.png?alt=media&#x26;token=f407bbe3-ca6b-478a-8193-766a1fa3aa1d" alt=""><figcaption></figcaption></figure>

&#x20;Save the settings.

#### Step 3. **Connect the Metaobject with the theme sections**.

&#x20;To link metaobjects to the theme blocks or sections, go to the theme Editor and select a part of the store to work on, for example, **“Products”**. Then, decide what section or block to use on a page:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2F8GCtJZIWgsJp0ojQmiX5%2Fproduct%20page.png?alt=media&#x26;token=8371ff2b-249d-46f4-a7c8-14a2e2d4c425" alt=""><figcaption></figcaption></figure>

&#x20;Press the source icon next to each field in the block/section to connect the Metaobject reference with the field:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2FL2aousEMe2pclpcIhCx0%2Fproduct%20page_references.png?alt=media&#x26;token=a6ae107f-c57f-41b8-85b6-b039113d214a" alt=""><figcaption></figcaption></figure>

&#x20;In the Metaobject reference, select an entry to use for each field:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2Fubouo3I46eci5bl05waY%2Fproduct%20page_entries.png?alt=media&#x26;token=04b74112-540d-4e84-8a0f-29fd00704e8e" alt=""><figcaption></figcaption></figure>

&#x20;Use different Metaobject references to connect with various sections in the block:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2F7OhSYx9PiCE4ALMsOcgP%2Fproduct%20page_connect%20entries.png?alt=media&#x26;token=6db3cf9c-a73b-4fd7-8925-b5c6ed92269d" alt=""><figcaption></figcaption></figure>

&#x20;Save the settings.

{% hint style="info" %}
The same metaobjects can be used in other dynamic sections on the Product page. Add a section and specify the content using the source icon.
{% endhint %}

&#x20;In our example, we used the “Information line” section with three “Content” blocks:

<figure><img src="https://1204500216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McsaSlZSE2uMqzAxy2S%2Fuploads%2Flx83OASCo5NBbmdKQq0j%2Feditor_metaobject%20reference.png?alt=media&#x26;token=8981726c-9757-43cd-b6c0-2ff191f40d7e" alt=""><figcaption></figcaption></figure>
