Use your Online Store 2.0-compatible theme with Shopify’s metafields feature to display dynamic content in product page blocks.
For this guide, we will use a metafield to display fabric composition or material information on clothing product pages.
Add new metafield definition
Follow these steps to add a new metafield definition:
- In your Shopify admin, go to Settings > Metafields and metaobjects,
- Select Products under Metafield definitions.
- Click Add definition to create a new metafield.
Each metafield definition requires a Name, Type, and Description for internal reference.
Click Select type to choose from the available content types, such as:
- Color
- Date and time
- File
- JSON
- Measurement
- Number
- Rating
- Reference
- Text
- True or false
- URL
For this example setup, we’ll use the Text content type to add material information for products.
Save, then go to the Products section of your Shopify admin.
Add metafield content in the Products admin
From the Products admin, select the product you want to update. Scroll down to the Metafields section, then add the value beside the newly created metafield.
Save, then go to the Themes portion of the Online Store.
Connect metafield to theme feature
Metafields are connected to theme sections or blocks. For this example, we are connecting the dynamic content for the Material metafield with a Text block.
- Open the Theme editor, then open a product template.
- Under the Product section on the left sidebar, select Add block, then Text.
- In the top-right corner of the text field, select the Connect dynamic source button.
- Select Material, then Insert.
For this example, we have moved the Text block position below the product Title.