Leverage your customization by using dynamic sources and metafields

In some cases, you may want to display different product information on a case-by-case basis. The Be Yours theme supports Shopify dynamic sources, allowing you to connect product metafields to compatible theme sections and blocks.

This guide explains how to create a product metafield, assign values to products, and connect that metafield to a block using Insert dynamic source.

STEPS:

1. Understanding Dynamic Sources and Metafields

Metafields allow you to store custom information for your Shopify resources, such as products, collections, pages, or variants.

Dynamic sources allow you to connect that metafield data directly to compatible theme settings in the Theme Editor.

Example use case:

Product Product characteristics metafield
Calathea Stromanthe Triostar Prayer plants family. Grows best in warm, humid conditions and well-drained, fertile soil.
Fiddle Leaf Fig Large glossy leaves. Prefers bright indirect light.
Monstera Deliciosa Tropical plant with split leaves. Best in bright indirect light.

Instead of writing the same content manually in the Theme Editor, you can create a metafield once and assign different values to each product.

2. Creating a New Product Metafield Definition

In this example, we will create a product metafield called Product characteristics.

  1. From your Shopify admin, go to Settings > Metafields and metaobjects.
  2. Select Products.
  1. Click Add definition.
  1. Enter the metafield name.

Example:

Product characteristics

After you enter the name, Shopify will automatically recommend a Namespace and key.

  1. If you want to change the recommended namespace and key, click the suggested Namespace and key value. Shopify will then show the fields so you can edit them manually.

For this example, use:

custom.product_characteristics
  1. Optional: Add a description.

Example:

Add key information to describe the product.
  1. Click Select type.
  2. Choose Multi-line text.
  3. Select One value.
  4. Add validation rules if needed.
  5. Click Save.

Recommended setup:

Field Value
Name Product characteristics
Namespace and key custom.product_characteristics
Type Multi-line text
Value type One value
3. Adding Metafield Values to Products

After creating the metafield definition, you can add a different value for each product.

  1. From your Shopify admin, go to Products.
  2. Open the product you want to edit.

You can use the Filter products search field to find the product faster.

  1. Scroll down to the Metafields area.
  2. Click Show all if needed.
  1. Find the Product characteristics metafield.
  2. Add the product-specific information.

Example:

Prayer plants family. Grows best in warm, humid conditions and well-drained, fertile soil.
  1. Click Save.

Repeat this step for every product that needs its own custom information.

4. Connecting the Metafield to a Theme Block

After adding metafield values to products, you can connect the metafield to a compatible theme setting.

In this example, we will connect the Product characteristics metafield to a Collapsible row block on the product page.

  1. From your Shopify admin, go to Online Store > Themes.
  2. Find the Be Yours theme and click Customize.
  3. Open the template selector at the top of the Theme Editor.
  4. Go to Products > Default product.
  5. Open the Product information section.
  6. Click Add block.
  7. Select Collapsible row.
  8. Drag the block to the desired position.
  1. In the Collapsible row settings, choose an icon and add a heading.

Example heading:

Product characteristics
  1. In the content field, remove the default text if needed.
  2. Click the Insert dynamic source icon.
  3. Select Product characteristics from the dynamic source list.
  4. Click Insert.
  5. Click Save.

The metafield content will now be displayed dynamically based on the current product.

5. Previewing the Result

After connecting the metafield to the block, preview the product page.

For example, the product Calathea Stromanthe Triostar will display the content added to its Product characteristics metafield.

If you open another product and add a different value to the same metafield, the same block will automatically show that product's own metafield value.

6. Understanding Dynamic Source Icons

To know whether a setting supports metafields, check if the setting has an Insert dynamic source icon.

There are two common types:

Icon type Meaning
Single dynamic source icon You can connect one metafield.
Dynamic source icon with plus You can connect multiple metafields, up to Shopify's supported limit.

Single dynamic source icon:

Dynamic source icon with plus:

Dynamic sources are commonly available in settings such as text, rich text, image, page, URL, and collapsible row content, depending on the section or block.

7. Recommended Use Cases

You can use dynamic sources and metafields for many product-specific details.

Examples:

Use case Suggested metafield type
Product characteristics Multi-line text
Materials and care Multi-line text
Ingredients Multi-line text or list of single line text
Size guide note Single line text or page reference
Delivery estimate Single line text
Product badges List of single line text
Technical specifications Multi-line text
Download file File
Custom image File or image

Recommended approach:

  1. Create the metafield definition.
  2. Add values to products.
  3. Connect the metafield to a compatible theme block using dynamic source.
  4. Preview different products to confirm each product shows its own value.
8. Notes and Limitations

Please note the following behavior:

  • A metafield definition must be created before you can add values to products.
  • Each product needs its own metafield value if you want different information per product.
  • A dynamic source can only be connected to compatible theme settings.
  • If a setting does not show the dynamic source icon, that setting may not support metafields.
  • If the metafield value is empty for a product, the connected block may show nothing or may not display as expected.
  • The namespace and key must be correct if you are referencing the metafield in Liquid code.
  • Shopify now automatically recommends a namespace and key after you enter the metafield name. To edit it, click the suggested namespace and key value.

Troubleshooting

If the dynamic source or metafield content does not display correctly, please check the following:

  • Make sure the metafield definition has been created under Settings > Metafields and metaobjects > Products.
  • Make sure the product has a value assigned to the metafield.
  • Make sure you clicked Save after editing the product metafield value.
  • Make sure the theme setting supports dynamic sources.
  • Make sure the correct metafield is selected from the dynamic source list.
  • If the content does not appear, check whether the metafield value is empty for that product.
  • If you are using Liquid code, make sure the namespace and key are correct.
  • Clear your browser cache and refresh the storefront.
  • Make sure you are using the latest version of the Be Yours theme.

Need Further Assistance

If you encounter any issues or need additional help with your Be Yours theme, please reach out to our support team via our Ticket System for assistance within 8 hours.