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.

How to Use Dynamic Sources and Metafields in Be Yours

STEPS:

1. Understanding Dynamic Sources and Metafields

Metafields allow you to store custom information for Shopify resources, such as products, collections, pages, variants, customers, orders, and more.

Dynamic sources allow you to connect 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 product-specific content manually inside the Theme Editor, you can create a metafield once and assign different values to each product.

Recommended use cases:

Use case Example content
Product characteristics Plant care, material, texture, or key features
Ingredients Product ingredients or formula details
Materials and care Fabric, washing instructions, or care guide
Delivery note Product-specific shipping or availability note
Size guide note Extra sizing information for a specific product
Technical specifications Dimensions, weight, compatibility, or product specs
2. Creating a New Product Metafield Definition

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

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

Example:

Product characteristics

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

  • 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
  • Optional: Add a description.

Example:

Add key information to describe the product.
  • Click Select type.
  • Choose Multi-line text.
  • Select One value.
  • Add validation rules if needed.
  • 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.

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

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

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

Example:

Prayer plants family. Grows best in warm, humid conditions and well-drained, fertile soil.
  • 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.

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

Example heading:

Product characteristics
  • In the content field, remove the default text if needed.
  • Click the Insert dynamic source icon.
  • Select Product characteristics from the dynamic source list.
  • Click Insert.
  • 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.

This means one product template can display different content for each product, depending on the metafield value assigned to that product.

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
  • Product
  • Collection
  • Collapsible row content

Availability depends on the section or block setting.

If a setting does not show the dynamic source icon, that setting may not support dynamic sources.

7. Recommended Use Cases

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

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
Related size chart Page reference
Product-specific URL URL

Recommended workflow:

  • Create the metafield definition.
  • Add values to products.
  • Connect the metafield to a compatible theme block using dynamic source.
  • 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 the recommended namespace and key, click the suggested namespace and key value.
  • Metafield definitions are stored in Shopify, not inside the theme.
  • You do not need to recreate metafield definitions after updating or reinstalling the theme.
  • Dynamic source support depends on Shopify and the setting type used by the theme.

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.